The Earth's magnetic field provides an obstacle in the flow of the solar wind, and it becomes compressed into a tear-drop shaped bubble known as the "magnetosphere." The magnetosphere protects the Earth by shielding it from the solar wind.
However, under certain conditions charged particles from the solar wind are able to get through Earth's magnetic shield and get energized. When this happens, they crash into the Earth's upper atmosphere and create the light which we see as an "aurora."
This spectacular example of the Aurora Borealis, also called the Northern Lights was taken on July 25 2004 in Wisconsin.
Photo Credit : Chris VenHaus 2004