Why Is It Colder in the Mountains Since They Are Closer to the Sun?

When mountain climbers climb the high mountains covered by the snow, the year wear thick down coats. Why is it colder in the mountains since they are closer to the sun? On the surface of the earth, there is a very thick layer of air. It is like a thick quilt and keeps the earth warm. But this layer of air is not evenly distributed. The closer to

the surface of the earth, the thicker the air and the warmer it is; the farther away from the earth, the thinner the air and the colder we feel.