When an atom is ionized, its ion has different energy levels from the neutral atom. We can separate the photons into their different colors or wavelengths by using either a prism or a diffraction grating. These types of devices are refered to as spectroscopes. Do not worry how the diffraction grating works. Do not worry about what specifically makes electrons jump up into the higher levels, only that energy must be added to the atom.
Temperature is a measure of the random motions of atoms.
As the temperature of something rises the atoms move faster. There is actually a mathematical connection between the temperature of a body and the random velocities of its atoms, but we do not need it for this course. If the substance is a gas, the atoms move through space until they hit another atom or a wall. It is the impacts of the atoms on a wall that gives us gas pressure. If the substance is a solid, the atoms are locked into place in the crystal and vibrate back and forth.