The light from any extended source, for example a lightbulb at a distance of a few feet, may be viewed through the spectrometer to see the component colors of the light. Light enters the spectrometer from the source through the entrance slit, a very narrow vertical opening, typically a few hundred microns wide, and travels to a diffraction grating. The diffraction grating spreads the light from the slit into its component colors, with each color traveling in a different direction. The result is similar to the dispersion of colors by a glass prism; however, the explanation for the diffraction grating's spreading out of the colors (inteference of light traveling through many slits) is somewhat different than the explanation in a prism (each color has a different speed in the glass). The theory of the diffraction grating may be found in introductory optics books, for those interested. When the slit is viewed through the diffraction grating, at an angle, the spectrum, or component colors, of the light entering the slit is seen by the eye. The lens of the eye focuses the image of the entrance slit onto the retina. However, since each color travels in a slightly different direction, the eye forms an image of the slit for each color, with the individual color images displaced horizontally from each other.
Some light sources, such as a tungsten filament lightbulb, will be seen to have a continuous spectrum -- all of the visible colors are present, and the spectrum resembles a rainbow. Other light sources, such as a fluorescent light, will have sharp individual colors, in addition to a weaker continuous spectrum. These sharp spectral lines are light given off by mercury atoms within the fluorescent light. Atoms of a given element have their own characteristic set of colors, or spectrum. Viewing the light given off by some types of light sources is a way to identify the elements within the light source.