Hi James.
I should start by saying that we are still not completely sure how a
sunspot is created, although we think we are making progress on the
question.
To come up with the theories that we have, we combine a mix of data and
modeling. The data is based on measurements of sunspots and their
magnetic fields as we can see them above the surface - we can figure
out the strength and often direction of the magnetic fields and how
they change with time. Also in the last decade or so we have been able
to measure the conditions below the sun's surface, both right below the
sunspots and in general.
We then combine these observations with what we know about physics,
including magnetic fields and convection, to try to come up with models
for how sunspots work - for instance that they might be the result of
magnetic flux ropes coming up from below the surface. We then try to
make predictions based on these models and test them. If the models
predictions don't work out we know there is something wrong with the
model.
Some more specific information on how we measure things:
Near surface of the sun we can measure the strength and direction of
magnetic field using something called the Zeeman effect: magnetic
fields alter the number and polarization of certain spectral lines and
we can measure that. This is harder to do higher up in the corona, but
we can still figure out things about the shapes of the magnetic fields
by observing the hot plasma that is trapped in them.
Beneath the surface we have been using a technique called
helioseismology - studying the vibrations of the sun to figure out what
is going on inside.
Some illustrations of helioseismology applied to a sunspot from SOHO:
http://sohowww.nascom.nas...hotshots/2001_11_06/
http://sohowww.nascom.nas...hotshots/2001_12_10/
Magnetic loops in extreme ultraviolet seen by TRACE:
Cheers,
Terry