Spectral lines occur when electrons transition from higher to lower energy levels in the shell of excited atoms. The wavelength of the light emitted during the transition is determined by that energy differential:

Because the energies E1 and E2 can only take on discrete values, only photons with discrete frequencies are emitted or absorbed. Taken all together, the frequencies which occur are referred to as the spectrum of the atom. The arrangement of the spectral lines is characteristic for the element concerned.
Experiment C1.1.3.7 investigates flame colourations of metal salts. A compact spectrometer with a USB link to the computer makes it easy to record such transient events and to analyze the emission lines which are produced. Unlike in classical observation with the eye, lines in the IR range can also be identified, e.g. for potassium.