The further away from the earth's surface you go, the cooler the atmosphere. The air near the earth's surface may change temperature in another manner also. As winds blow the air up or down mountains, or areas of higher elevation, the air pressure decreases, and the air cools. If moisture is present in the air, it can cool sufficiently to condense the moisture into rain or snow. The air blowing down a mountain undergoes compression, due to the lower elevation, and will become warmer.
Clouds tend to dissipate in air moving down a mountainside.
That is why the windward sides of mountain ranges receive much more precipitation than the leeward sides. See the ANL Data Archive section for monthly summaries of data. It does not work that way in the atmosphere, as the atmosphere is not a constant volume. An increase in temperature in a high pressure area as it is warmed by the sun causes expansion of the area both horizontally and vertically, thereby resulting in only a minor increase in pressure. That is because high pressure areas during the summer are warmer and build up more air above them.