Supersonic gas from a star creates a radial shock front moving away from the star. In front of the shock front the gas is compressed and heated. Behind the front is the hot expanding gas from the star.

MHD (magnetic field) is also important in accelerating charged matter in a shock and therefore further heating the gas.