Flame tests are used to determine the composition of unknown salts. When presented with a beaker of an unknown solution or solid of which you need to dispose, it's generally a Good Thing to know whether it can go down the drain or whether it needs to go into a waste container. In a flame test, the substances being tested will actually change the color of the flame, depending on (of course) the substance. This is a result of emission spectra which in turn are a result of electrons returning from an excited state to their ground state.
There are a number of ways one could perform a flame test. Among those, these are three:
Now while all the pretty colors are fine and dandy, wouldn't it be nice if you could make something of them? Here's a list of the substances which provide a useful flame test:
Fireworks are a good example of where these metals and metal ions are useful. For example, copper (II) chloride, CuCl2, is used in fireworks to create blue showers of sparks.