BOOM. Curiously Wikipedia failed me on this one, forcing me to trawl Google image search for a decent diagram that explained how sunspots are formed step-by-step because I’ll be damned if I’m doing it without one. Addison Wesley, I do not know if you are a person or a textbook publishing company or whatever, but you make good diagrams. I’m stealing them.
Okay, so, the Sun’s surface magnetic field starts out much as you’d expect with the field lines running from pole to pole. However, since the Sun is a giant flaming ball of gas/plasma and not a solid object, these magnetic field lines are not static. In particular the Sun rotates more quickly at the equator (25 day rotation) than it does at the poles (36 day rotation); this differential rotation drags the field lines out of shape and twists them up to a greater and greater degree, kind of like winding up a spring. Once the field lines are twisted enough they will “snap and the Sun’s magnetic field will go BLARG, like this:
Now, you see those weird-ass magnetic field loops at the end of the animation? Those can puncture the surface of the Sun, like this:
The magnetic loop inhibits the flow of plasma into regions where it is present, resulting in those areas being a little less hot than the rest of the Sun – the diagram says a difference of about 1000 kelvin although sunspots can be anywhere between 3000-4500K. This doesn’t sound like much, but the luminosity of a thing is proportional to the fourth power of its temperature, as
where L is luminosity, R is the temperature of the star, σ is the Stefan-Boltzmann constant and T is the temperature. Since we’re dealing with two areas of the same stellar object here we can chuck out all that other junk and just say
which means that if you plug in the temperature of a sunspot (3000 – 4500K) and the temperature of the Sun’s photosphere (5750K) into this equation, you get some numbers that say sunspots are between 1 and 30 percent as luminous as the rest of the Sun. Because sunspots are so dim and the Sun is so bright, this makes sunspots appear to us as dark patches on the Sun’s surface. Wikipedia tells me that if you looked at a sunspot on its own it’d be about as bright as an arc lamp; I don’t know what an arc lamp is but it sounds pretty bright. Sunspots are only dark because they’re comparatively dim, not because they’re actually dim. Because the magnetic loop punctures the Sun’s surface in two places that are close to one another, sunspots almost always occur in matching pairs.
Now, after the magnetic field lines become all mangled like that the Sun basically says “Whoa now, things are getting a little out of hand!” and promptly resets its magnetic field back to what it was before; the actual physics behind this can be broadly understood as the magnetic field lines becoming so twisted that they end up at a complete 180 to where they started out, which is why every time there’s a magnetic field “reset” the polarity of the Sun’s magnetic reverses and then the differential rotation process starts all over again. This is the solar cycle, with the Sun undergoing one polarity reversal every 11 years, and it’s very important for understanding space weather because the Sun gets more volatile as its magnetic field grows increasingly out of whack. Solar flares and CMEs tend to originate from the areas in which sunspots have formed, while the Sun just generally vomits out more electromagnetic radiation when going through a sunspot phase which can swamp the Earth and really mess up certain bits and pieces of our technology which rely heavily on the transmission of electromagnetic waves, like radio.
This is why you’ll sometimes hear astronomers refer to the solar cycle, solar maxima and minima and the sunspot cycle. When there are no sunspots, the magnetic field of the Sun is relatively well-ordered and it is in a solar minima with minimal activity. As the solar cycle progresses and the magnetic field becomes more twisted, sunspots begin to appear and solar activity ramps up. Towards the end of the eleven year cycle there are many clusters of sunspots to be found on the Sun’s surface thanks to the highly misshapen magnetic field lines and there’s a marked increase in the occurence of violent solar events like coronal mass ejections. Then the field reverses and resets, the sunspots disappear and the Sun becomes relatively calm again.
And that’s what sunspots are: literally Sun acne. Hope this helps!