The surface temperatures of the planets vary from more than 400 degrees on Mercury and Venus to below -200 degrees on the distant planets. The factors that determine the temperature are a complex balance between the amount of heat received and that lost.
The heat received by a planet varies with its distance from the Sun, for it is the Sun's radiation which is by far the greatest source of planetary warming. There are additional sources of heat such as gravitational contraction which adds to the energy balance in Jupiter's atmosphere and also small contributions from radio-active decay. These effects are dwarfed, however, by the influx of energy from the Sun.
The Sun's energy
The Sun emits radiation through all the electromagnetic spectrum from radio-waves to Xrays. This radiation spreads out through the whole solar system. In the same way that we receive more heat from a fire when we are close to it than we do when we are a long way from it, the planets which are close to the Sun receive more heat than those further away. This simple fact explains broadly the range of surface temperatures for the planets according to their distance from the Sun. The actual situation is more complicated.
What happens to the Sun's radiation when it reaches a planet?
Radiation from the Sun is lessened by the inverse square law as it reaches further and further away from the Sun. So the further away that a planet is from the Sun then the less radiation it receives. What happens to that radiation depends on whether the planet has an atmosphere, whether the atmosphere contains clouds and how the clouds, or the surface, reflect the radiation.
Planets with no atmosphere
For planets with no atmosphere all the Sun's radiation will strike the surface. Some of this will be reflected away from the planet but the rest will be absorbed. The temperature of the surface will be raised until there is equilibrium between the energy radiated by the warm surface of the planet and the received solar radiation. For planets like Mercury, this results in a very hot surface where the Sun is shining (more than 400°C) but very cold on the night side, where the radiation from the surface rapidly cools it to -180°C.
The Moon is similar in many ways to Mercury. The night-side of the Moon is at almost the same temperature as that of Mercury but the day-side, due to the lesser amount of radiation received because it is further from the Sun, reaches 110°C.
Planets with atmospheres
The Earth is, of course, a planet with an atmosphere and we can use it as an example. Our atmosphere is largely transparent to the incoming solar radiation although there are constituents in the atmosphere which prevent some kinds of radiation from reaching the surface, such as ozone which stops the ultraviolet. A fair proportion of the Earth is covered by clouds which reflect a lot of the Sun's radiation and it has been postulated that drastic change in the amount of cloud could precipitate an ice-age (thus dramatically affecting the surface temperature).
The atmosphere affects the radiation emitted by the warm Earth and traps some of this by the `greenhouse effect'. Carbon dioxide is the main constituent which does this and there are fears that increases in the amount of this gas in the atmosphere will cause global warming of the Earth and change its climatic patterns. The other main effect of the atmosphere, particularly when it is cloudy, is to trap the radiation from the Earth during the night, keeping the temperature fairly close to that in the day.
The planet Venus is an extreme example of the `greenhouse effect'. Venus is surrounded by clouds which prevent a lot of the Sun's radiation from reaching the surface and so we might have expected the surface to be cool. However, the atmosphere of Venus is largely composed of carbon dioxide which traps most of the radiation from the planet's surface. This is so effective that the surface is heated to 470°C!
The planet Mars has an atmosphere but this has a surface pressure less than one hundredth of the Earth's. It thus has only a small effect and the surface of Mars can vary between 0°C in summer and -100°C in winter.
The giant planets
The giant planets all have only small solid cores which are surrounded by enormously thick layers of liquid forms of substances that on Earth we encounter as gases. The giant planets receive only a small amount of radiation from the Sun and this is insufficient to raise their temperatures above the point at which these gases liquefy or freeze.
Minor bodies in the solar system
Most minor bodies in the solar system have no atmospheres and so can easily radiate any heat received from the Sun. This means that on their sunward facing sides they will be warm (the temperature depending on their distance from the Sun) but any part which is not warmed by the Sun will be colder than -200°C.
The effect of rotation
The Earth rotates once per day. This means that the temperature of the unwarmed side has only a short time to cool. At the poles this is not true and so the temperature there can fall much lower. The same effect holds for the other planets but the effects can be far more drastic.
Mercury has no seasons because there is a coupling between its rotational and orbital periods. This means that some places on the surface receive more than two and a half times as much radiation from the Sun than others.
Mars has seasons rather like the Earth, but the distance of Mars from the Sun varies much more than the Earth's does and so this effect is correspondingly much greater.
Of the giant planets the most peculiar climatically is Uranus whose rotation axis is almost in the plane of its orbit. This means that winter at its poles lasts 42 Earth-years!