A closer look at Emission line
An atom or ion can emit a photon when an electron moves to a lower energy level.
Only certain level differences are available, so a thin glowing gas can produce distinct bright lines.
A nebula may look red in an image because one hydrogen line contributes a large share of the visible light reaching the camera.
Want to learn more about Emission line? Spectral line on Wikipedia.

