The atmospheres of stars like the sun are threaded by strong magnetic fields. These fields can suddenly release vast quantities of energy -- just as the Earth has electrical storms, stars have magnetic storms. A description of the magnetic fields of stars is emerging which draws upon techniques usually used by knot theorists and topologists. This talk will describe how the geometry and topology of magnetic fields in the sun generates solar flares.