The earth’s atmosphere is heated through radiation by the sun. This means the wavelengths of the sunlight are absorbed by the molecules hence exciting them. When a mass of air is heated by radiation, it becomes less dense creating an area of low pressure. The air rises and cooler air mass moves in to replace the rising air. This is how winds are created.