Atomic spectroscopy is the technique for
determining the elemental composition of an
analyte by its electromagnetic or mass spectrum.
That based on the same principle as the flame test used in qualitative analysis.
When an alkali metal salt or a calcium, strontium or barium
salt is heated strongly in the Bunsen flame, a characteristic
flame colour is observed
The high temperature of the flame excites a valence electron
to a higher-energy orbital. The atom then emits energy in the
form of (visible) light as the electron falls back into the lower
energy orbital (ground state).