Respuesta :

Louli
When the metal is heated, the electrons of the metal ion gain energy and can jump to a higher energy level where the ion becomes unstable.
Due to this non-stability, the electrons return back to their original level releasing the gained energy in the form of light.
Since these transitions are different from one metal to another, the light released from each metal has a specific color that characterizes this metal.

It is good to note that the flame test is more useful for some metals that the others, especially those of the first group.