The reason is the thick atmosphere contains mostly carbon dioxide, a greenhouse gas. The energy is then re-radiated by the ground in the form of infrared light, or heat. The carbon dioxide absorbs the heat, and traps it inside the atmosphere. This is the greenhouse effect . Yes, both the Earth and Mars have slight greenhouse effects.
Some greenhouse effect is good.
It keeps a planet warm, like a blanket in the atmosphere. The greenhouse effect on Venus is MUCH stronger than on the Earth and Mars. No one knows if Venus ever had an environment similar to the Earth's. However, even with all of the environmental damage we are doing to the Earth, Earth is not likely to develop a greenhouse effect similar in magnitude to the one that makes Venus so hot as a result of anything humans can do. The Face on Mars is simply a natural rock formation.