I know that photons are particles of light—but how are photons related to the “excited” electrons in the atoms of a gas discharge?
An atom in a gas discharge emits light when one of its electrons shifts from an orbital with extra energy into an empty orbital in which it will have less energy. Since an electron can only travel around the atom’s nucleus in an allowed orbit—an orbital—and the energy it has while in that orbital is very specifically defined, such a shift from one orbital to another results in the emission of a photon of light with a very specific energy. Because a photon’s energy is directly proportional to the frequency of the light, and light’s frequency and wavelength are related by the speed of light, the amount of energy the electron gives up in shifting from one orbital to another determines the photon’s energy, frequency, and wavelength.