The sun shines with more than light, it also shines with a lot of tiny subatomic particles. If these all hit the earth there would be no life, but we are lucky! The Earth has a magnetic field that protects us from these particles, but the field is weaker near the north and south poles so the particles hit the atmosphere and make it shine!
And that is the northern lights! It happens at the south pole too, where it is called the southern lights.