The flame test is commonly used to identify different metal ions by how they get excited in the presence of a flame.
Typically a nichrome wire is dipped in a solution of metal cations and then presented to a flame. The flame emits a different color than normal, depending on the type of metal cation. Each metal ion gets excited by the flame and as the electrons change energy levels they emit a photon of light, thus changing the color. Since each metal cation has unique energy levels, the colors differ depend on the metal cation.
I hope this helps.