On this page
Salt in a gas flame glows yellow-orange. Sunlight through a spectroscope shows two thin dark gaps in that same yellow. Same sodium atoms, seen two ways.
What is the difference between an emission and an absorption spectrum?
Gustav Kirchhoff set out three rules in the mid-1800s, summarised in Penn State's astronomy course notes:
A hot solid, liquid or dense gas gives a continuous spectrum: every colour, no gaps.
A hot, low-density gas seen against a cooler background gives an emission spectrum: bright lines on a dark background.
A cool, low-density gas in front of a hotter continuous source gives an absorption spectrum: dark lines cut into the rainbow.
The difference is where the light starts: in the gas itself (emission), or in something hotter behind the gas, which then removes a few precise colours on the way to you (absorption).
Why are the lines in the same place?
Electrons in an atom can only have certain energies. When an electron drops from a higher level to a lower one, the atom emits a photon whose frequency is fixed by the gap, ν = (E2 − E1)/h; when it absorbs a photon of exactly that energy, it jumps up the same gap (Penn State). Same gap, same photon energy, same wavelength, whichever way the jump goes.
Sodium shows this neatly. NIST's sodium line table lists neutral sodium's bright yellow pair at 588.995 nm and 589.592 nm (wavelengths in air). In 1859 Kirchhoff and Robert Bunsen began vaporising elements and studying their spectra, and in their 1860 paper they connected sodium's double yellow line to the dark double D line in sunlight, suggesting sodium in the Sun's atmosphere (Linda Hall Library).
A fair question: if the gas absorbs those photons, the excited atoms must give them back, so why do the lines stay dark? Because re-emitted photons go off in every direction, while the absorption removes light only along your line of sight (Penn State). Seen from the side, against dark sky, the same cloud would show bright lines.
Worked example: the energy behind sodium's yellow
Photon energy is E = hc/λ. NIST gives exact values for Planck's constant in electronvolts (4.135667696 × 10^−15 eV s) and the speed of light (299 792 458 m/s), so hc ≈ 1239.84 eV nm.
Take the first NIST sodium line, λ = 588.995 nm.
E = 1239.84 / 588.995 ≈ 2.105 eV.
Repeat for λ = 589.592 nm: E ≈ 2.103 eV.
The two gaps differ by about 0.002 eV, which is why you see a close pair rather than one line.
Hot sodium vapour emits photons of these energies; cool sodium vapour absorbs them. More practice: the E = 1240/λ photon-energy formula.
How do spectra identify elements in flames and stars?
No two elements have the same set of energy levels, so each has its own pattern of lines, like a fingerprint (Penn State). Measure the wavelengths and you can name the element, whether the lines are bright or dark.
In a flame. The flame test in your chemistry lab is emission spectroscopy with your eyes as the detector. Chemistry LibreTexts/Descriptive_Chemistry/Elements_Organized_by_Block/1_s-Block_Elements/Group__1%3A_The_Alkali_Metals/2Reactions_of_the_Group_1_Elements/Flame_Tests) lists lithium as red, sodium as a strong, persistent orange, potassium as lilac and copper as blue-green, and traces sodium's colour to electrons falling from the 3p level to 3s. It also notes that a nichrome wire always leaves a trace of orange in the flame.
In a star. A star's dense interior gives a continuous spectrum, and cooler gas above it cuts dark lines into it. Match each dark line to a laboratory line and you have a list of elements in that gas. On 18 August 1868, during a total solar eclipse, Jules Janssen recorded a bright yellow line at 587.49 nm from the Sun's chromosphere (Physics Today), observing from Guntur, India (Universe Today). Norman Lockyer saw it two months later and called it D3, and the unknown element was named helium, after the Greek word for the Sun; it was isolated on Earth only in 1895 (Physics Today). The line was bright because the chromosphere at the Sun's edge is thin, hot gas against dark sky: Kirchhoff's second rule.
How do you tell them apart in an exam?
Run this check:
What is the background? Dark with a few bright lines means emission. A full rainbow with thin gaps means absorption.
Where does the light start? In the gas: emission. In a hotter source behind it: absorption.
Do an element's dark lines sit where its bright lines are? Yes. Any option that shifts them is wrong.
The commonest slip: a glowing filament gives a continuous spectrum, not a line spectrum.
For hydrogen's series, try these hydrogen spectrum problems. If energy levels still feel shaky, the Fermi Concept Library has a lesson for every concept in physics and chemistry, so you can step back to atomic structure first. For the history, read about Gustav Kirchhoff and the birth of spectroscopy.



