As the solar wind interacts with the fringes of the earth's magnetic field the particles flow around the earth. Some of the particles are trapped by the earth's magnetic field. The particles from the solar wind strike the gases in the atmosphere causing them to glow. This is the same way electrons passing through gases in a neon tube make a neon sign. The colors correspond to the gases they strike.
Oxygen atoms give off read and green light depending on how high they are in the atmosphere.
Nitrogen moelcules give off blue and violet light. There is a constant interaction between the solar wind and the earth's magnetic field. It is not unusual for the solar wind to generate 100,000 megawatts of electricity in a three hour auroral display. This can cause temporary interference with power lines,radio and television broadcasts and satellite to earth communications. By studying auroras, scientists can learn more about the solar wind and how it affecs the earth's atmosphere.