What happens to the charged particles which came from the sun after they hit the atmosphere of the earth?
After 2-5 days' travel trough space, the plasma from the sun reaches the earth's magnetic field compressing it on the daylight side of the earth, and stretches it into a 'tail' on the night side. Most, however, are forced around the earth by the magnetic field and enter the 'tail'.
The magnetic tail is divided into two by a sheet of plasma. The magnetic field lines from the earth's north and south pole stretch out in their respective halves such that the fields are in opposition. The electrons and protons in each half of the plasma rotate in opposite direction forming a huge 'dynamo' with the positive pole on the side of the plasma sheet facing dawn and the negative pole facing evening. The 'dynamo' is driven by the current of charged particles between the two poles.
When the northern lights break out the following happens. The solar wind strengthens and the magnetic tail becomes unstable. Charged particles dive inwards towards the center of the tail and cause it to increase in length and to taper. The particles draw the magnetic field lines toward the center where they meet causing a magnetic 'short-circuit'. This occurs especially at the 'dynamo's' two poles where a large amount of energy becomes stored. The magnetic field lines from both sides of the plasma layer now act as conductors in the 'dynamo's' outer circuit.
The circuit closes when the particles reaches the ionosphere, the outer layer of the earth's atmosphere. Here the thin gasses are composed of ionized particles and consequently act as electrical conductors. It is here that the 'dynamo's' energy is converted to light.
Most of the northern lights we see originate in the electrons accelerated into the ionosphere. These electrons give energy to atoms in the ionosphere (such as nitrogen, hydrogen, oxygen). These atoms quickly decay back into the normal (ground) energy state, and photons are released. These photons create the northern lights.
Jason Heidecker, Physics Undergrad, Occidental College, Los Angeles