Hi Victoria!
The astronomer Edmund Hale was first to show that the Sun has a magnetic field. He examined spectral splitting in sunspots and discovered that they have strong magnetic fields. The spectacular manifestations of magnetic activity at the Sun are solar flares and coronal mass ejections.The first flare was observed by Richard Carrington in 1859 (which caused a great magnetic storm at the Earth) and CMEs were discovered by a coronagraph onboard OSO-7 satellite in 1970s
Emilia