Here's how it works:
* Solar Flares: The sun emits bursts of charged particles called solar wind.
* Earth's Magnetic Field: Earth's magnetic field acts like a shield, deflecting most of the solar wind. However, some particles leak through near the poles.
* Charged Particles: These particles interact with gases (mainly oxygen and nitrogen) in the Earth's upper atmosphere (thermosphere).
* Excitation & Emission: The collision excites the atoms in the gases, causing them to release energy in the form of light. Different gases emit different colors: oxygen produces green and red light, while nitrogen produces blue and purple.
This beautiful display of light is often seen in high-latitude regions, close to the magnetic poles.