How does the temperature of air affect air density?
Heating of the earth, which in turn heats the atmosphere, is responsible for the motions and movements of the air in the atmosphere. The faster molecules move, the hotter the air. As the molecules heat and move faster, they are moving apart. So air, like most other substances, expands when heated and contracts when cooled. Because there is more space between the molecules, the air is less dense than the surrounding matter and the hot air floats upward. This is the concept used in the hot air balloons. The air is heated by the burner and the expanding air becomes less dense, causing the balloon to rise through the denser, cooler surrounding air.