NASA has released an astonishing video  of a solar flare erupting on surface of the sun. Crack open something to drink, put on some suitably epic music, whack this full screen and sit back and gaze:
The video was taken over the course of 21 hours on July 19 last year, and shows first a solar flare, erupting from the lower right hand "limb" of the Sun. Then, a coronal mass ejection sprays some of that material deep out into space. And finally, "coronal rain" starts dropping the bulk of the matter back onto the sun's surface.
Slate's Bad Astronomy describes what caused it :
The gas inside the Sun is so hot it’s ionized, stripped of electrons. When that happens it’s more beholden to magnetism than gravity, and when the magnetic field lines pierce the Sun’s surface they form loops along which the ionized gas (called plasma) flows along them.
The bright flare happens when the stored magnetic energy erupts outward, usually due to what is essentially a short-circuit in the field. That happens near the beginning of the video, and is so bright it saturates SDO’s detectors (and you can see repeated ghost images to the upper left and right of the flare as the light reflects inside SDO’s optics). Then things settle down, and that’s when the beauty really begins: The plasma flows down the loops, raining down onto the Sun’s surface.
The coronal mass ejections — CMEs — can sometimes be aimed directly at Earth. When a small one hits, it causes aurorae in the far north and south, but larger ones can cause power outages and affect satellites.