The light spectrum emitted by the Sun has "spectral lines", or emission features (deep dips or strong peaks) that are determined by light-absorption or light-emission from specific elements (e.g., Nickel, Iron, and of course Hydrogen) in the Sun's atmosphere.
If the little packet of stuff that was absorbing light is moving toward or away from you, the characteristic frequencies of all its spectral lines will be Doppler shifted. So, you can measure the velocity of that packet of stuff by seeing how much the line is shifted. Since you have a lot of photons, you can do this independently across the Sun's surface and get a spatially-resolved map of velocity ("Dopplergram", http://solar-center.stanford.edu/dopplergram.html).
If the little packet of stuff was in a magnetic field, its spectral lines will be split into sub-lines due to the Zeeman effect. So, you can also measure the spatially-resolved magnetic field of the Sun, and this is called a "magnetogram".
It is kind of surprising that this measurement can be made at all.