It comes from the Sun!
The Sun is a big magnet.
During solar minimum the Sun's magnetic field, like Earth's, resembles that of an iron bar magnet, with great closed loops near the equator and open field lines near the poles. Scientists call such a field a "dipole." The Sun's dipolar field is about as strong as a refrigerator magnet, or 50 gauss. Earth's magnetic field is 100 times weaker.
During the years around solar maximum (2000 and 2001 are good examples) spots pepper the face of the Sun. Sunspots are places where intense magnetic loops -- hundreds of times stronger than the ambient dipole field -- poke through the photosphere. Sunspot magnetic fields overwhelm the underlying dipole; as a result, the Sun's magnetic field near the surface of the star becomes tangled and complicated.
The Sun's magnetic field isn't confined to the immediate vicinity of our star. The solar wind carries it throughout the solar system. Out among the planets we call the Sun's magnetic field the "Interplanetary Magnetic Field" or "IMF." Because the Sun rotates (once every 27 days) the IMF has a spiral shape -- named the "Parker spiral" after the scientist who first described it.
Above: Steve Suess (NASA/MSFC) prepared this figure, which shows the Sun's spiraling magnetic field from a vantage point ~100 AU from the Sun.
Earth has a magnetic field, too. It forms a bubble around our planet called the magnetosphere, which deflects solar wind gusts. (Mars, which does not have a protective magnetosphere, has lost much of its atmosphere as a result of solar wind erosion.) Earth's magnetic field and the IMF come into contact at the magnetopause: a place where the magnetosphere meets the solar wind. Earth's magnetic field points north at the magnetopause. If the IMF points south -- a condition scientists call "southward Bz" -- then the IMF can partially cancel Earth's magnetic field at the point of contact.
Above: Earth's magnetosphere. From the Oulu Space Physics Textbook.
"When Bz is south, that is, opposite Earth's magnetic field, the two fields link up," explains Christopher Russell, a Professor of Geophysics and Space Physics at UCLA. "You can then follow a field line from Earth directly into the solar wind" -- or from the solar wind to Earth. South-pointing Bz's open a door through which energy from the solar wind can reach Earth's atmosphere!
Southward Bz's often herald widespread auroras, triggered by solar wind gusts or coronal mass ejections that are able to inject energy into our planet's magnetosphere.
Back to spaceweather.com