Coronal mass ejections (CMEs) from the Sun send out charged particles which interact with the Earth's magnetic field and atmosphere. When these charged particles come into the Earth's outer atmosphere - the ionosphere - they interact with molecules there to create light. Since the easiest ways for the particles to enter the Earth's atmosphere is near the magnetic north and south poles, those are the areas that most often experience auroras (auora borealis near the North Pole and aurora australis near the South Pole).
The Earth's atmosphere is 78% nitrogen gas (N2) and 21% oxygen gas (O2) with 1% everything else. It's in the ionosphere, also called the thermosphere, where the charged particles (ions) from the Sun first start coming into contact with these atmospheric gases.
As these charged particles come into the outer atmosphere some of them collide with electrons orbiting the oxygen or nitrogen atoms and knock them up to a higher orbital (energy state). This excitation of the electrons is temporary and the electrons quickly pop back down to a lower orbital giving off energy in the form of photons of visible light as they do so. The resultant glow from a myriad of these interactions is what forms the aurora.
The color depends on whether or not the molecule being excited in oxygen or nitrogen and it depends on the orbitals an electron is jumping between (from orbital 2 back to 1, from 3 to 2, from 3 to 1, etc.). Each of these jumps gives off a photon with a characteristic wavelength of visible light energy. Oxygen emissions tend to be green or brownish-red while nitrogen emissions tend to be blue or red (if both are occuring, a purple color can be seen). Below is a nice aurora picture showing green, red, and purple light.
Under favorable conditions, auroras can be seen here in the Hudson Valley (I saw a red one during the last sunspot cycle). So, hw can you know if a CME erupts during this sunspot cycle and there's a chance to view auroras here in the Hudson Valley (or wherever you live)? I use SpaceWeather.com which has handy email elerts you can sign up for (in addition to having lots of other neat information).