Why do elements create different colored flames when burned?
The flame is exciting an electron in the atomic electron configuration into a higher orbit. As it cools and falls back to its orignal position, a photon of light is emmited. Since each element has a defined and unique electronic configuration, the wave length of light that is emitted during this process is also unique. This leads to the different colors associated with the different elements. In this way, astronomers study stars to learn what elements are present.