Quantum mechanical models of atoms predict that atoms can absorb specific wavelengths of the electromagnetic spectrum and release the absorbed energy in other forms such as heat. Working on the visible light spectrum, or commonly called as just “light”, each wavelength translates to colors. Different wavelengths correspond to the different colors perceivable with the naked eye. The color white is perceived when all the wavelengths are present, while black when all the wavelengths are absent.
In theory, when we pass white light into let’s say a cloud of gas, the gas absorbs specific wavelengths that depend on the atoms present in the gas. After passing white light to the cloud, we could use a prism to split the light into its constituent colors. From there, we should see certain discontinuities in the spectrum that appear as black lines. These black lines are called absorption lines.
The locations of these black lines correspond to the wavelengths that the atoms in the gas absorbed. Since atoms absorb energy only at specific wavelengths, we could use absorption lines to determine exactly what atoms are present in the gas. This technique, called absorption spectrometry, is widely used as a remote sensor to determine the composition of interstellar space. We could use light that reaches the Earth from a star or quasar to determine through what elements has the light passed before reaching the Earth.