Mercury has extreme temperatures because it has no atmosphere. This is because this planet has a very low mass and so it can't hold onto gases readily. They escape into space. It's also fairly close to the sun and its magnetic field is almost non-existent.