Mars' atmosphere is made mostly of carbon dioxide, much like Venus. It is not as hot as Venus because the Martian atmosphere is extremely thin. Venus has a thick layer of carbon dioxide gas surrounding the planet. This is why it is the hottest planet in the solar system even though it is not the closest to the sun. Carbon dioxide is a greenhouse gas so it has the ability to trap infrared radiation. The atmosphere on Mars is thin and so it will not trap as much heat as the Venusian atmosphere.