The electromagnetic spectrum, of which light is a fraction, is a continuous distribution of wavelengths ranging from ultraviolet to infrared radiation. When electromagnetic radiation in the form of light passes through a material, certain parts of it are absorbed or emitted by the medium. When observing this light through a spectroscope, those parts appear as a line spectrum — either brightly colored emission lines on a dark background or dark absorption lines on a brightly colored background.
When white light passes through a diffraction grating, a continuous spectrum of light appears. The diffraction grating has separated the light into its different wavelengths, from violet to red, in the visible range. This continuous spectrum is given off by incandescent solids, liquids, and gases under high pressure. The two best known examples of this are white light through a prism and through water drops, which makes a rainbow.
There are two types of line spectrum: an emission spectrum and an absorption spectrum. The first is also called a bright line spectrum and consists of a few brightly colored lines against a dark background. Each line represents a unique wavelength, and the entire thing is unique to that particular element. These lines are emitted when a low-pressure gas is put into contact with an electrical discharge.
A dark-line spectrum, or absorption spectrum, is exactly the opposite — instead of bright lines at each wavelength on a dark background, an absorption spectrum has dark lines at the corresponding wavelengths on a continuous background. This result is the main focus of absorption spectroscopy, and it is created by passing light through a gas of the element to be analyzed.
Physicist Niels Bohr introduced in 1913 his idea of why the atomic spectrum has the characteristics and properties it has. To do so, Bohr theorized his own model of the atom, now called the Bohr model. It assumes that electrons can only exist in discrete orbits around the nucleus and that only certain orbits are stable, meaning the electron doesn’t emit radiation. Radiation is emitted, however, when the electron moves from a higher-energy orbit to a lower orbit.
Spectroscopy is the analysis of this phenomena using a machine called a spectroscope. No two elements emit or absorb the exact same line spectrum, so these observations can be used to determine the elements in a sample. As a result, astronomers have begun to turn their spectroscopes to the stars in an attempt to determine their composition and that of any interstellar medium between a particular star and Earth.