We investigate the dynamics of the Josephson vortex lattice in layered high-Tc superconductors at high magnetic fields. Starting from coupled equations for superconducting phases and magnetic field we derive equations for the relative displacements [phase shifts] between the planar Josephson arrays in the layers. These equations reveal two families of steady-state solutions: lattices with constant phase shifts between neighboring layers, starting from zero for a rectangular configuration to π for a triangular configuration, and double-periodic lattices. We find that the excess Josephson current is resonantly enhanced when the Josephson frequency matches the frequency of the plasma mode at the wave vector selected by the lattice structure. The regular lattices exhibit several kinds of instabilities. We find stability regions of the moving lattice in the plane lattice structure -Josephson frequency. A specific lattice structure at given velocity is selected uniquely by boundary conditions, which are determined by the reflection properties of electromagnetic waves generated by the moving lattice. With increase of velocity the moving configuration experiences several qualitative transformations. At small velocities the regular lattice is stable and the phase shift between neighboring layers smoothly decreases with increase of velocity, starting from π for a static lattice. At the critical velocity the lattice becomes unstable. At even higher velocity a regular lattice is restored again with the phase shift smaller than π/2. With increase of velocity, the structure evolves towards a rectangular configuration.