Like a prism, a diffraction grating separates the colors (or wavelengths) in a light beam to produce a spectrum.
Most natural light (sunlight, hot metal, fire), when passed through a grating, produces a continuous spectrum: every wavelength in the visible spectrum is present.
Light emitted by a hot gas, however, produces a discrete line spectrum. This means that gas atoms emit light only at a few specific wavelengths. The emission lines provide evidence that the energy levels of an atom is quantised, which explains why the atom to is constrained to lose energy only in specific amounts.
When white light is passed through a cool gas, an absorption line spectrum is produced. The dark lines show that the gas atoms can only absorb light at a few specific wavelengths. The absorption lines provide evidence that the energy levels of an atom is quantised, which explains why the gas atoms to constrained to gain energy only in specific amounts.
Are you curious to the light spectrum of various light sources?
1. Gas discharge lamps (xmdemo)
2. Filament Lamp, LED and Fluorescent Lamps (xmdemo)
3. Sunlight (xmdemo)
4. High pressure Sodium Lamp (xmdemo)