The auroras (both Northern and Southern Lights) are caused by massive eruptions on the sun’s surface, coronal mass ejections (CME’s). These explosions create the so-called solar wind, electronically charged particles shooting through space. When this solar wind is directed at the Earth, most of these particles will be diverted by the Earth’s magnetic field. Some, however, make it to our atmosphere, where they collide with atoms in our atmosphere. With the energy from these collisions, an electron in these atoms is ‘shot’ to a higher orbit around the nucleus. When this electron falls back to its regular orbit, energy is released in the form of a proton: light. The different colours are caused by different atoms being hit at different altitudes.
The most common colour, as also seen in these pictures, is green. Green northern lights are caused by collisions between 100 and 250km altitude, where there is a high concentration of oxygen. Above 250km height, the level of oxygen is less. The solar wind, however, has still more power at this altitude, allowing the molecules to be exited at a higher frequency, causing red northern lights. With the smaller concentration, however, these reds are often outpowered by the brighter and lower greens. At lower latitudes, this is the more predominant colour of the Aurora, as it is higher in the atmosphere, making it easier visible further away from the auroral oval.
When the solar wind makes it below 100km (but usually above 80km) one can see blue or purple auroras. At this altitude the most common molecule is nitrogen, and when this molecule is excited, it creates blue or purple lights.
For more information, I can recommend this website.