a flame test is a test for chemicals. normally it is used to see whether there are certain metals in a chemical compound. the chemical compound is heated in a flame and a colored flame is made. the colored flame can be turned into its spectrum to analyze it. many metals produce flame colors. the colors are made by electrons jumping up to higher orbits in the atom when it is heated. they fall down soon, putting out light as energy.