The story of the Northern Lights (or Aurora Borealis) starts deep inside the Sun. The core of the Sun is a nuclear furnace that converts hydrogen atoms into helium atoms through nuclear fusion. This is a process that releases a tremendous amount of energy. When you look at the Sun, essentially what you see is a huge hydrogen bomb that is contained by the force of gravity. It has been around for over 4 billion years, and about that much more time is left before the core runs out of hydrogen. All the energy that is generated in the core moves out through the Sun as electromagnetic radiation, or light.
You can imagine that if you were close to the surface of the Sun, the amount of energy hitting you would be tremendous. You could not survive there. Similarly the atoms in the solar atmosphere can't get away unscathed either. Some of their electrons are stripped from them by the Sun's energy, making them positively charged ions. This plasma (a gas of charged particles) is so hot it continuously expands outward through space creating a solar wind.
These solar wind particles carry a lot of energy, and eventually stream past the Earth's own magnetic field, the magnetosphere. It is a huge windsock-shaped magnetic bubble, and acts as a partial shield against the solar wind. The magnetosphere also contains plasma, the origin of which is not well understood yet. The interaction of the solar wind and the magnetosphere drives huge electric currents in the magnetosphere. Because of these currents, the electrons and protons in the plasma come down in field lines.
The gas in the Earth's upper atmosphere becomes excited and ionized as it absorbs the incoming energy. The atoms in our atmosphere re-emit this energy in the form of light – the aurora. Exactly the same way we make a neon sign glow by sending a current through it! The aurora mostly originates from a layer in the atmosphere about 80 km to 300 km above us. We see it in "sheets," sometimes changing quite rapidly due to the shape and dynamics of the Earth's magnetic field that guides the particles.
The flow of particles coming towards the Earth is usually roughly ring-shaped, centered around the magnetic poles of the Earth. In Ontario's far north, for example Moosonee and Polar Bear Provincial Park, you can see the northern lights on many clear nights. Even further north, for example in Yellowknife in the NWT, northern lights are actually visible every night! In places like Sudbury we usually have to wait for strong solar wind activity – a solar storm, which makes the ring of aurora around the north pole expand southward, to see the lights.
To learn more about increasing your chances of viewing the northern lights, visit this recent article: Increase Your Odds: Viewing the Northern Lights. And, to view the northern lights from the comfort of home, you can check out the AuroraMAX camera by the Canadian Space Agency.
The colour of the aurora depends on what gas is excited or ionized and at what altitude this happens. At the highest altitudes oxygen atoms emit red light. At lower altitudes green light from oxygen atoms starts to dominate. When solar activity is very high, we may also see blue and purple light coming from the lowest part of an auroral display. Nitrogen molecules emit these colours.
So when you are lucky enough to see the spectacular display of the aurora, what you are really witnessing is the interplay between the Earth and the Sun's magnetic fields and the energetic particles flowing through them. You are witness to the beauty of some very complex physical processes. The beauty of physics!