The internal temperatures of the planets cannot be directly measured, but they can be inferred in a variety of ways. For the Earth, we can combine seismic studies and laboratory experiments to estimate the temperatures at various depths. For other planets, we rely on heat radiated from their surfaces, surface features which suggest one kind of geologic history or another, theories of the origin and evolution of the planets, and theories of the origin of planetary magnetic fields. Sometimes different lines of evidence yield different estimates of planetary temperatures, but the range of temperatures discussed below are probably closer to the actual temperatures than not.
Theories of Planetary Formation and Evolution
We know, from a number of lines of evidence, that the inner Solar System was very hot at the time the planets were forming, and that large amounts of rapidly-decaying radioactive materials were mixed into the rocky bodies that formed close to the Sun. As a result, all of the inner planets must have been mostly or totally molten during the last stages of their formation (see The Melting and Differentiation of the Planets).
The heat sources which melted the inner planets must have disappeared very early on. The Sun, which was a major source of heat at the very start of things, rapidly shrank in size and brightness, and became an insignificant factor within a few millions of years. The most important radioactive materials decayed to nonexistence within a few tens of millions of years. And collisional heating, which was once thought to be the most important factor, is now believed to have been a relatively minor factor, especially by the time the planets were more or less their final size, and there was little left for them to run into. As a result, the planets would have begun to resolidify almost as soon as they melted, and as the heat stored inside them gradually made its way to the surface, they would have slowly cooled off.
As heat leaked from their interiors, larger planets should have cooled more slowly than smaller ones, because with larger masses, they had more heat stored inside them in comparison to their surface areas (doubling the size of a planet increases the ratio of mass to surface area by a factor of two), which means more heat has to escape to reduce their temperature by a given amount. But even if the internal heat of a smaller planet caused internal temperatures to rise just as rapidly as you go downwards as in larger planets, the smaller distance between the surface and center should result in lower central temperatures for the smaller planets. Both factors suggest that smaller planets should have cooled off considerably more than larger ones in the four and a half billion years since they were formed.
Based on this, we should expect the Earth, as the largest of the Terrestrial planets, to have the highest internal temperatures. Venus, with a slightly smaller mass and size, should have comparable temperatures. But Mars and Mercury, being much smaller, should be considerably cooler than either the Earth or Venus.
For the Jovian planets, the gravitational compression of the huge amounts of gaseous materials which make up their structure should have produced far higher internal temperatures, early on, than for the Terrestrial planets. As a result, if they had similar structures, they should be much hotter. However, they are made of fluids (primarily gases compressed to densities even higher than those of typical liquids), and heat flow in fluids can be much faster than in the solid rock which makes up the outer layers of the Terrestrial planets. So although the Jovian planets were probably once much hotter than the Terrestrial planets, that cannot ensure that they are still hotter than the inner planets. All we can say, based on this theory alone, is that Jupiter, being by far the largest and most massive Jovian planet, should be substantially hotter than Saturn, which should be much hotter than the smaller Jovian planets, Uranus and Neptune.
Note that although this theory of heating and cooling suggests relative temperatures within a given group of planets, for any given planet, accurate temperature estimates depend upon additional lines of evidence.
Heat Radiated By the Planets
At the current time, most of the heat once stored inside the planets has leaked to their surfaces, and been radiated away. As a result, the heat of the Sun is the primary source of heat at their surfaces. In fact, for the Terrestrial planets, the heat absorbed from the Sun and the heat radiated by the planets is so nearly identical that uncertainties in the two values, small though they are, are much larger than any heat still leaking from their interiors.
For the Jovian planets, however, this is not true. Jupiter radiates nearly three times as much heat as it absorbs from sunlight, meaning that two-thirds of its surface heat budget is derived from heat leaking out of its interior. For Saturn, heat leaking from the interior is considerably smaller than for Jupiter, but is still about half of the surface heat budget. As discussed in the (relatively old, relatively brief) planet by planet discussion below, this implies that Jupiter is still extraordinarily hot inside, and Saturn, though not as hot as Jupiter, is probably twice as hot (inside) as the earth. For Uranus and Neptune, the heat flow from the interior is much smaller, and they probably have lower internal temperatures than the Earth, but not as much lower as might have been thought, forty or fifty years ago.
(Author's Note to Self: (1) the relationship of surface features to internal thermal history, (2) the relationship of magnetic fields to internal temperatures, (3) seismic studies of the Earth, and (4) "flex" measurements of Mercury and Mars)
(The following discussion, based on lecture notes now several years old, is relatively correct and complete, but needs some additions and revisions in the light of recent discoveries.)
The Internal Temperatures of The Terrestrial Planets
Mercury: Its extremely cratered surface implies little if any geological activity since the end of the heavy bombardment of the Solar System around 4 billion years ago. In addition, the small size of the planet should allow any heat left over from its formation to escape quickly. Both these factors would lead to a prediction of a low internal temperature, probably less than 4000 Fahrenheit degrees, and, most likely, a completely solid interior.
Venus: Radar imaging seems to show an extremely volcanic, and otherwise substantially changed surface, with an almost complete destruction of the cratering which would have occurred in its early history, implying a substantial amount of geological activity throughout its history. The large size of the planet should allow much of the heat left over from its formation to be easily retained. However, there are also a large number of large craters which would have taken the best part of half a billion years or more to be formed, implying that the geological activity otherwise so apparent on the planet's surface may have ceased at some time in the past. This implies that the planet is at least somewhat cooler than the Earth, probably less than 10000 Fahrenheit degrees in the core, and may well be entirely solid, although substantial molten regions cannot be ruled out on this basis alone.
Earth: Shows extreme geological activity, so that the surface mostly completely changed on
time scale which is short compared to 100 million years (this is in addition to weathering and erosion, which act on an even shorter time scale). In addition, its size, the largest of the Terrestrial planets, should allow it to hold in more heat than the smaller planets. Finally, earthquake studies PROVE the existence of a mostly molten core. As a result of laboratory studies of the behavior or materials at high temperature and pressure, its internal temperature is believed to be in excess of 12000 Fahrenheit degrees.
Mars: Half of its surface contains huge, partially weathered craters almost certainly dating back to over 4 Billion years ago, whereas the other half has many volcanoes and stress fractures, implying at least some internal activity, although not on the huge scale of Venus or Earth, continuing to within a few million years of the present time. The small size of the planet should allow heat to escape fairly easily, and with its looks being intermediate between those of Mercury and the larger Terrestrial planets, it would be expected to have internal temperatures between 5000 and 7000 Fahrenheit degrees. This might lead to partial melting of the interior, depending upon the composition of the central regions.
The Magnetic Fields of the Terrestrial Planets, and of The Moon
The magnetic fields of the Terrestrial planets should be created by convective motions within molten metallic cores. In some theories, this motion alone is capable of causing a net planetary field. In others, a relatively fast rotation of the planet is also necessary, so that the Coriolis effect of the rotation can organize the internal convection parallel to (and/or anti-parallel to) the rotation axis of the planet.
Earth: Known to have molten core, rapid rotation, and a fairly strong magnetic field (strongest of the Terrestrial planets), nearly parallel to its axis of rotation (although it does move around a bit over long periods of time). Theory predicts a strong magnetic field under these circumstances, which agrees with observation.
Moon: Its heavily cratered, presumably ancient surface, slow rotation, and probably solid core (based on LIMITED seismic studies) predict that it should have no magnetic field. No magnetic field is observed, again in agreement with theory.
Mars: Its in-between geology suggests it is possibly too cool for molten core, or possibly just hot enough. Because of its relatively rapid rotation (almost as fast as the Earth's), a molten core should produce magnetic field, but only a minuscule field is observed, which implies that it may be too cool (probably less than 5000 Fahrenheit degrees) to have a molten core. (added 2005) However, fossil magnetism at the surface suggests that the rocks which contain that magnetic signature were formed at a time, 4+ billion years ago, when Mars had a substantial magnetic field; and parallel striping of that fossil magnetism in certain areas suggests that in that same time frame, something occurred similar to the seafloor spreading and magnetic striping caused by magnetic field reversals in the Earth. So although Mars' core must be relatively cool and solid now, it was undoubtedly hot enough to create an active magnetic field and drive some mantle activity, in the very early days of the planet's history.
Venus: Its once-active geology suggests it probably had a molten core, but its large number of more recent craters suggests that the geological activity has ceased, so that the core may have cooled off and solidified, and in any event, its extremely slow rotation makes it possible that it might not have a magnetic field even if it did have a molten core. NO FIELD IS OBSERVED. This means either that it does have a solid core, or that those theories which require a rapid rotation to create a magnetic field are more likely to be correct, and those which do not require a rapid rotation are wrong.
Mercury: Ancient, heavily cratered surface implies no geological activity, probably low internal temperatures, and therefore probably no molten core. In addition, it has a slow rotation, so even if it had a molten core, it might not have a magnetic field. HOWEVER, it does have a magnetic field, albeit only about 1% as strong as ours. The presence of a magnetic field, combined with the absence of geological activity, is a puzzle. It may be due to the fact that Mercury has a very low central pressure, as a result of being the least massive of the Terrestrial planets, which would lower the melting point of the iron in its core, and make it possible for it to be partially molten while still being too cool to create motions in its stiffer, rocky mantle. However, that is an uncertain idea at best, and leads to the question of why Mars, which should be warmer, based on its size and geological activity, doesn't also have a partially molten core. Perhaps Mars' core, which is much smaller, is just too small to produce a field, or perhaps Mars' larger size and gravitational compression allow it to be solid, even at slightly higher temperatures. It also leaves the question of how Venus could avoid having a magnetic field, unless it has a completely solid core. As a result, the magnetic field of Mercury, despite its low strength, opens a Pandora's box of questions with no truly acceptable answers.
The Internal Temperatures of the Jovian Planets
Jupiter: Heat leaking from its surface is almost three times as much as that absorbed from sunlight, implying that almost twice as much heat is leaking out of planet as is coming from the Sun. This is partly due to large distance from the Sun (a little over 5 AU's), which causes it to receive less than 4% of the heat that we do, but this still requires a very large internal heat flow. In the case of the Earth, a temperature rise of 100 degrees (F) per mile near the surface produces very little heat flow (except at unusually warm places, such as volcanoes), but the crust and mantle of the Earth are made of'solid rock, and heat flows very slowly through such material. Jupiter is made of liquid hydrogen, and convective motions in such a liquid should be capable of moving heat outwards fairly easily. Estimates based on theory and lab experiments imply a temperature rise of only 1 Fahrenheit degree per mile might be adequate to explain such a heat flow, but since Jupiter is 44000 miles in radius, the central temperature could still be well over 50000 Fahrenheit degrees.
Saturn: This planet has only half its heat coming from the interior, and being further from the Sun than Jupiter, only needs 1/4 to 1/8 as much interior heat flow to produce this result. It is therefore thought that its internal temperature rises only about half as fast as in Jupiter, resulting in central temperatures of only 25000 to 35000 Fahrenheit degrees.
Uranus and Neptune are so far from us and the Sun, and have so little internal heat flow, that measurements prior to the Voyager 2 flybys were almost useless. Some heat flow has now been observed, but central temperatures are still very uncertain, and are probably less than 15000 degrees, and possibly considerably less than that.
The Magnetic Fields of the Jovian Planets
The basic theory is the same as for the Terrestrial planets, but since there is very little rock, let alone metal, in the Jovian planets, even completely molten cores and very rapid rotations might not produce fields strong enough to reach the huge surfaces with any substantial strength. Despite this, Jupiter has a VERY strong field, 10 times stronger at the surface than ours, which extends into space many times further than ours, with a total energy 1000 times greater than ours. Saturn has a relatively strong field (divide Jupiter's numbers by 10), which also requires a substantial energy to create it, and Uranus and Neptune, although their fields are only a fraction of the strength of the Earth's field, still require a substantial source of magnetic energy. For Jupiter and Saturn, the answer to the creation of their magnetic fields is believed to be metallic hydrogen. Normally, hydrogen is a non-metal, which tightly holds onto its lone electron. (Metallic properties are produced by atoms which have so many electrons that the outermost one can easily be detached and wander freely between the atoms in a liquid or solid state.) Under the tremendous ressures inside the Jovian planets, however, hydrogen is compressed so much (perhaps 30 to 40 times denser than normal inside Jupiter) that many atoms occupy the space normally filled by only a single atom, and although each electron is closer to its own nucleus than to other atoms' nuclei, being so close to so many nuclei can "confuse" some of the electrons, allowing them to wander from atom to atom, producing a metallic form of hydrogen. Recent lab experiments (testing the properties of hydrogen under high pressure) and theoretical calculations (involving the pressures inside the Jovian planets) suggest that although Uranus and Neptune are not likely to contain such a form of hydrogen, Saturn should have substantial amounts, and Jupiter may be mostly made of this strange liquid. If this is correct, it would easily explain the magnetic fields of Jupiter and Saturn, but for Uranus and Neptune, the magnetic fields are probably caused by convective motions in an outer core made mostly of electrically conductive liquids such as seawater.