The surface of the sun is around 5000 degrees Celsius. The solar corona, just above the surface of the sun, is two million degrees. Why?
The solar corona is a bit of a scientific mystery. The bright, shifting glow that's most visible during solar eclipses, it's made up of very hot plasma. Plasma is gas which has gotten so hot that it has ionized – shed some of its topmost electrons, rendering its atoms positively charged. Even though the electrons are still floating around with the positively charged atoms, the energy in plasma is so great that they don't stick together. Plasma is a special state of matter, shown to have different properties than liquids or gasses.
The particular properties of the corona are still largely unknown, though, since it isn't supposed to be where it is. Its primary purpose seems to be to make eclipses look cool, and to provide inspiration for what to put behind the heads of the saints in medieval religious paintings.
What's more, the corona seems to really have it in for logic, because although the surface of the sun is a cool five-thousand degrees, the corona can get up to two million.
This doesn't seem to make sense. The main heat generator for the sun, the nuclear fusion in its core, is farther away from the corona than it is from the surface of the sun. There isn't heat coming in from the empty space around the sun. Finding out that the corona is two million degrees is like finding a burning hot coffee mug full of ice water.
NASA scientists are beginning to zero in on exactly what is heating the corona up. Small, temporary magnetic fields, lasting about 40 hours each, pop up all over the surface of the sun. They appear and disappear randomly, like whack-a-moles, and like whack-a-moles, they cause energy to be continuously redirected. The sun already has many magnetic forces working on it. Magnetic field lines show the direction of the flow of charged particles in space. Every time a new magnetic field pops up, the natural flow of charged particles is changed as the field lines change. Remember, the corona is made up of charged particles. The result is like sticking a hand in a bowl of water and swishing the water around continuously. The constant motion, the constant redirection and the constant reapplication of energy will warm the water. Scientists believe it does the same for the corona.
There are still a lot of mysteries left. Why do these sudden magnetic fields pop up? How can scientists be certain that it they redirect magnetic field lines? Why would a writer feel compelled to mix a metaphor like whack-a-mole with water, since electricity and water make such a bad combination? (Or, for that matter, water and moles.)
Only more study can completely solve the mystery.