A flame test is used to visually determine the identity of an unknown metal or metalloid ion based on the characteristic colour the salt turns the flame of a bunsen burner. The heat of the flame excites the metals ions, causing them to emit visible light. The characteristic emission spectra can be used to differentiate between some elements.
Looks cool too: