Air molecules vibrate and bump against each other when heated. The molecules take up more space during these motions, causing air to expand. Because the molecules occupy a larger or same-size space with increased pressure, the air becomes lighter, or less dense.
Air becomes more dense when cooled. Cooler temperatures slow down air molecules, which means they take up less space. The reduction of space results in the air becoming heavier through reduced air pressure. Air pressure is an important factor in meteorology, since temperatures drop with rising temperatures. This temperature drop is caused by reduced atmospheric pressure at higher altitudes.