''A flame test is a procedure used in chemistry to detect the presence of certain metal ions, based on each element's characteristic emission spectrum. The color of flames in general also depends on temperature; see flame color''.
http://en.wikipedia.org/wiki/Flame_test
The flame test is used to visually determine the identity of an unknown  metal or metalloid ion based on the characteristic color the salt turns  the flame of a bunsen burner. The heat of the flame converts the metal  ions into atoms which become excited and emit visible light. The  characteristic emission spectra can be used to differentiate between  some elements. 
http://chemistry.about.com/od/analyticalchemistry/a/flametest.htm 
 





