The corona, however, has such a low density that the thermometer will almost never be hit. So while the thermometer is technically sitting in a gas that is at 2,000,000 kelvins, it doesn't know it. The gas has a high temperature but a low heat content. There are just not enough atoms around to heat our hypothetical thermometer or the underlying photosphere. The question of why the corona has such a high temperature is harder to explain, and probably the last word on the physical mechanism has not yet been given.
Most astronomers assume that the gas is heated by the magnetic field that pervades the corona.
The solar magnetic field has long been known to cause the sunspot cycle, and the physical shape and activity in the corona also varies with the sunspot cycle. Magnetic fields are known to be able to transfer large amounts of energy to the solar atmosphere, sometimes explosively as in flares. Huge magnetic loops can be seen to rise far into the corona, and it is quite plausible that the solar magnetic field is the ultimate source of physical heating of the corona. The shocks thereby dissipate mechanical energy in the waves as heat. Whatever the cause, some heat does indeed leak back toward the solar surface, but the total amount of energy so transported is really quite small, and cannot raise the photospheric temperature very much.