The sunspots are large concentrations of strong magnetic field. This magnetic field partially blocks some energy from getting though the surface.
And so the temperature at the surface is actually lower for sunspots than for other parts of the surface.
A lower temperatures means it appears darker.