Types of spectra.
An absorption spectrum is a spectrum of absorption lines or bands, produced when light from a hot source, itself producing a continuous spectrum, passes through a cooler gas. A material's absorption spectrum shows the fraction of incident electromagnetic radiation absorbed by the material over a range of frequencies. An absorption spectrum is, in a sense, the opposite of an emission spectrum.
Every chemical element has absorption lines at several particular wavelengths corresponding to the differences between the energy levels of its orbitals. For example, an object that absorbs blue, green and yellow light will appear red when viewed under white light. Absorption spectra can therefore be used to identify elements present in a gas or liquid. This method is used in deducing the presence of elements in stars and other gaseous objects which cannot be measured directly.
How an absorption spectrum is formed
Atoms and molecules may change states when they absorb specific amounts of energy. Atomic states are defined by the arrangement of electrons in atomic orbitals. An electron in some orbital may be excited to a more energetic orbital by absorbing exactly one photon which has energy equal to the energy difference of the two orbitals.
Molecular states are defined by the molecule's modes of vibration and rotation. These vibrational and rotational modes are quantized, similar to the atomic orbitals, and may be excited by absorbing single photons.
In both the atomic and molecular cases, the excited states do not persist: after some random amount of time, the atoms and molecules revert back to their original, lower energy state. In atoms, the excited electron returns to a lower orbital, emitting a photon. In molecules, the vibrational or rotational mode decays, also emitting a photon.
When this decay occurs, the photon produced is not necessarily emitted in the same direction as the original photon. The most common angle of this has been shown to be about 45 degrees of the original photon. This applies to any situation where gases lie between a light source and an observer: the observer will see gaps in the spectrum of the light corresponding to the wavelengths of the photons which were absorbed. These gaps occur despite the re-emission of photons because the re-emitted photons are equally likely to travel in all directions, and it is statistically unlikely to travel along the original path to the observer. These gaps appear as black lines in an image of the spectrum.