While Mercury is the closest to the sun, Venus has a thick atmosphere of carbon dioxide that traps heat through a runaway greenhouse effect, making it much hotter than Mercury.