The rapid penetration of magnetic flux into a Meissner phase of the type-II superconductor is studied analytically and numerically. A sharp shock wave front of the magnetic induction is formed due to the singularity of the resistivity at the transition from the mixed to the normal state. It is shown that current densities at the front reach high values, of the order of the depairing current density. The effects of the heat dissipation and transport on the motion and stability of the interface between the magnetic flux and flux-free domains are considered. The shock wave magnetic induction and the temperature profiles move with constant velocity determined by the Joule heat produced by the electric current in the normal domain at the flux front. The stability of the shock wave solution is investigated. For a sufficiently small thermal-diffusion constant, a finger-shaped avalanche instability appears.