The sun is HOT, tops of mountains are closer to the sun than the base, so why is are the tops covered in snow?
As others have said, the difference in distance between the sun and the tops and bottoms of mountains is insignificant. The real reason that mountain tops are colder is because generally the atmosphere gets colder as you go up. Some answers claim that it is because the air is thinner, but that is not the case. That argument applies well to ideal gases doing work against pistons, but there is no reason to assume that just because pressure is less that a gas should be cooler. The real reason is that the lower portion of the atmosphere is heated from below (by the heating of the land surface), and the higher you go the farther you are from the heat source, that is why it’s cooler.