Question: what happens inside the atoms of a substance when they are heated in a flame?
Answer: Heating an atom excites its electrons and they jump to higher energy levels. When the electrons return to lower energy levels, they emit energy in the form of light. ... Every element has a different number of electrons and a different set of energy levels. Thus, each element emits its own set of colours.