It is also the closest planet to the sun, with an average distance of about 36 million miles. Despite its small size, Mercury has a very dense core, which is thought to be composed mostly of iron. Its surface is heavily cratered and has a thin atmosphere made up of gases like oxygen, sodium, hydrogen, and helium. Mercury's surface temperature can vary greatly, ranging from extremely hot during the day to very cold at night.