Mercury receives the most heat and radiation from the Sun. It does not have the hottest surface because planets with atmospheres can trap heat coming either from the Sun (e.g., Venus) or the interior (e.g., Jupiter). As a result of its extreme greenhouse effect (caused by its atmosphere being almost entirely carbon dioxide, and covered by clouds that also help hold the heat in), Venus has the hottest solid surface. As a result of heat coming from a slow contraction of its deep interior, the vaguely-defined "surface" of Jupiter (where the gas becomes so dense that it's more a liquid than a gas) is even hotter.
Mercury is closer to the Sun but it has a very thin atmosphere and all the heat trapped goes out in space, while Venus with its much thicker atmosphere holds all the heat it gets. Without an atmosphere to retain that heat at night, temperatures can dip as low as -290°F (-180°C). Despite its proximity to the Sun, Mercury is not the hottest planet in our solar system that title belongs to nearby Venus, thanks to its dense atmosphere. Even though Mercury is closer to the Sun, Venus is the hottest planet in our solar system. Its thick atmosphere is full of the greenhouse gas carbon dioxide, and it has clouds of sulfuric acid. The atmosphere traps heat, making it feel like a furnace on the surface. It's so hot on Venus, the metal lead would melt. Since Mercury lacks an atmosphere, it has no way of trapping the heat that is generated by the sun, thus leading it to have periods of both hot and cold. Though it isn't the hottest planet, it is still comes in a respectable second place, even without an atmosphere. Carbon dioxide has the tendency to absorb heat which in turn increases the temperature. Mercury's atmosphere does not contain carbon dioxide (because of which all the heat is returned to space). Venus contains a high percentage of carbon dioxide due to which it is hottest planet. This is because of the fourth and all-important difference between the two worlds: Mercury has no atmosphere, while Venus has a very thick one. Transits of Venus (top) and Mercury (bottom)[+] Note how Venus' atmosphere diffracts sunlight around it, while Mercury's lack of atmosphere shows no such effects. With the hottest surface in the solar system, apart from the Sun itself, Venus is hotter even than the innermost planet, charbroiled Mercury. The atmosphere is mostly carbon dioxide the same gas driving the greenhouse effect on Venus and Earth with clouds composed of sulfuric acid. Despite being the closest planet to the Sun, Mercury "only" reaches 800 °F at its hottest. Venus is always hotter, even at night. As the innermost planet in the Solar System, Mercury receives the most radiation from the Sun: almost four times as much as Venus receives.