sometimes if it rains.
Air cools when it rises through the atmosphere because as altitude increases, air pressure decreases and allows the individual air molecules to expand away from each other.
Adiabatic cooling occurs when the pressure on an adiabatically isolated system is decreased, allowing it to expand, thus causing it to do work on its surroundings. When the pressure applied on a parcel of air is reduced, the air in the parcel is allowed to expand; as the volume increases, the temperature falls as its internal energy decreases. Adiabatic cooling occurs in the Earth's atmosphere with orographic lifting and lee waves, and this can form pileus or lenticular clouds.