When metal ions are heated they emit light. The wavelengths of the light a specific to that particular metal ion. Unlike flame tests, flame emission spectroscopy detects the individual wavelengths that are emitted using a spectroscope.
Every different metal ion produces a different pattern of wave lengths. So they all produce a unique line spectrum.
The intensity of the lines indicates the concentration of the ion.
The main advantage of flame emission spectroscopy is that if a sample contains multiple different metal ions, the spectrum will show the lines for all of them. For example, you can see both A and B's line spectrums here:
If we have an unknown sample we can use the patterns of known metal ions to determine what is in the sample. They can also calculate the concentration of each ion.
Flame test vs Flame emission spectroscopy is a good comparison of manual tests (normally basic and cheap) vs instrumental methods (use expensive machines but often give better results)
The 3 main benefits of instrumental methods are:
Very accurate
Very sensitive
Very fast
First, metal ions are heated until they emit light.
The light is detected by a spectroscope which can distinguish between the individual wavelengths of light emitted.
As each metal ion emits a unique combination of wavelengths it will produce a unique line spectrum.
This allows us to identify an unknown metal cation by comparing its line spectrum to those of known metal cations in a data bank.