Venus is hotter due to the greenhouse effect: Venus has an atmosphere about ninety times thicker than that of Earth, and made almost entirely of carbon dioxide, which is one of the gasses that causes the greenhouse effect on Earth. The greenhouse effect on Venus is so great that it raises the surface temperature on Venus to, as you say, hotter than that of Mercury, despite being farther from the sun.