https://www.nps.gov/articles/-articles-aps-v8-i1-c9.htm#:~:text=Light%20Emission%20in%20Aurora wrote:
Light Emission in Aurora
When energetic electrons strike an atom or molecule, they slow down and transfer some of their energy to that atom or molecule. The molecules can store this energy only for a very short time, and then radiate the energy away as light. Some molecules get dissociated into atoms in this process, and some molecules and atoms get ionized. At the altitude where aurora occurs, above about 62 miles (100 km), the air is thin enough that oxygen can exist in atomic form, while the air that we breathe contains only molecular oxygen. During the day, the ultraviolet sunlight splits the molecular oxygen into atoms, while at night the aurora continues this process.
When an atom or molecule emits light as a photon, to rid itself of its excess energy, that photon has a wavelength that is characteristic for that atom. We perceive wavelength as color. Laboratory experiments can reproduce these light-emitting processes by forcing a current through an evacuated glass tube that contains a small amount of a selected gas. The study of these light-emitting processes led to the understanding of atoms early in the twentieth century, and to the discovery of quantum mechanics. Because each type of atom or molecule emits colors unique to it, we can use the colors of the aurora to determine the atmospheric composition at the auroral altitude.
The time that a molecule or atom can store the energy that it gained in a collision is very short, typically between 1/1000 and less than 1/1,000,000 of a second. Atomic oxygen is one notable exception, and the excited state that causes the most common auroral emission, the green line, has a lifetime of 0.7 seconds. When an excited atom takes that long to radiate away the internally stored energy, other processes, chemical reactions or collisions, compete with the radiation process for that energy. The denser the air is, the more frequent are the collisions between the atoms and molecules. Below the altitude of about 59 miles (95 km), collisions are so frequent that the green oxygen line has no chance to be emitted. All the energy that is put into the oxygen atom is lost before the 0.7-second lifetime allows radiation. This determines the bottom edge of the green emission in aurora.
However, the auroral electrons sometimes have enough energy to give them the punch to penetrate deeper than that into the atmosphere. When that happens, only emissions with a much shorter lifetime are possible. The most abundant gas is molecular nitrogen, and it radiates promptly in deep blue and red colors. Mixing these together gives purple. The bottom edge of a green auroral curtain gets this purple color when auroral elec-trons are accelerated to very high energy (Figures 7-8).
On occasion the aurora gets a deep red color. This comes from higher altitudes, around 120-180 miles (200-300 km). It is again the oxygen atom that is responsible for this color. The oxygen atom has an excited state for this red line emission with a mean lifetime of 100 seconds, and only at very high altitudes are collisions infrequent enough to allow this radiation to be emitted (Figure 9). Since the long life-time of the oxygen red line also allows the aurora to move before it radiates, the de-tailed structure in auroral curtains is also washed out in these emissions (Figure 10).