How are spiral galaxies formed?
Astronomers now believe that the spiral arms are actually density waves. Density waves move through the stars and gas in the galaxy, compressing them briefly, and then moving on to compress the stars and gas in the next region of the galaxy. The stars and gas themselves do not move with the wave; they are simply compressed by it as it passes through their region. The compression causes the stars and gas to heat up, and triggers star formation. This is why we see ionized gas (hot gas) and young (newly formed) stars in the spiral arms.