I never asked myself this question but as I was searching about the sun, I found how auroras are created. First let me introduce you the Coronal Mass Ejection (CME). A CME is an explosion that occurs in the sun for several hours it happens when two different magnetic fields are brought together this results in the release of high energy particles (solar energetic particles).  This massive explosions due to the high energy particles can affect the Earth’s magnetosphere by their enormous energy that turns into a geomagnetic storm thus affecting our electronic devices (e.g. making Gps inaccurate)   See the article on Space.com for more information concerned to the video 
CME are the reason for the formation of the auroras along with the solar wind (plasma released on the upper atmosphere of the sun, consisting mostly in electrons and protons) . When it approaches Earth, it triggers reactions that lead to the emissions of photons (that we perceive as visible light) .
I hope you liked and you learned something new!
References and further reading.
 – Solar Wind – Wiki
 – About Auroras – Nasa