What causes the different colors?

Explaining the colors of the aurora is complex as it involves quantum mechanics, according to which atoms and molecules can only exist in discrete states with specific energies. An atom/molecule may jump to an “excited” (higher energy) state by absorbing energy from a particle collision or a photon (unit of light). Excited states are unstable, and the atom/molecule will eventually jump back to a state of lower energy. It can do so in two ways: By giving off the excess energy in a particle collision or, if no collisions occur in time, by spontaneously emitting a photon with an exact wavelength (i.e. a specific color) corresponding to the energy expelled. A given species can only emit specific wavelengths (i.e. colors). For example, the green and red colors most commonly observed both come from atomic oxygen (O), while the pink lower border in energetic auroras is a mix of blue and red emissions from nitrogen molecules (N2). Which color dominates at a given altitude is determined by a mix of factors: Which species dominate, how frequently particles collide (this is determined by density) and whether there’s sunshine at the given altitude (this happens close to dusk and dawn).