An absorption spectrum is a diagram depicting the wavelengths of electromagnetic radiation absorbed by a material, usually a gas. It can be regarded as the opposite to an emission spectrum, which is a depiction of the specific wavelengths emitted by a material.
Let us consider white light, which consists of electromagnetic radiation at all frequencies, passing through a sample of cold gas. For any collection of atoms or molecules, there are certain specific amounts of energy required to change state; for individual atoms, these correspond to an electron moving from one orbit (energy level) to another. An electron can jump to a higher orbit if it is given the exact amount of energy by one single photon, which is a quantum of energy. Using E = hf, a photon's energy is directly related to its frequency (and hence its wavelength).
Only those wavelengths that correspond to a jump of an electron to a higher orbit are absorbed by the gas. Afterwards, the electron does not stay in its higher orbit and falls back down, emitting a photon of exactly the same frequency as the one absorbed. However, this is emitted in all directions, not just in the direction in which the electromagnetic radiation was originally travelling. If the material is a gas, this results in dark absorption lines seen in the spectrum when viewed through a spectroscope. The wavelengths of these lines shown are particular to particular elements, and allows for identification of elements present in stars and other gaseous objects that cannot be measured directly.