Hello there my friend, the venus has its atmosphere mainly composed of carbon dioxide gas which is one of the greenhouse gases. When sun light hit venus, it passes through the CO2 layer and warm up the venus surface, and the surface emits infrared radiation which can't penetrate the CO2 layer and is retained in Venus, thus Venus is heated up significantly. On the other hand Mercury dont have as much CO2 as Venus, and greenhouse effect is eliminated and heat is dissipated quicker.