Absorb sunlight and the infrared the planet emits outward. The gases re-emit it, in all directions, including back to us. This is the greenhouse effect . Adds 40 K to the temperature of the Earth but almost 500 K to Venus. Greenhouse effect warms air nearer the ground, warmer air makes convection start in layers above it.
Warm air expands, gets less dense, rises to the top of the troposphere where it cools and falls.
Above the troposphere is the stratosphere . This layer is most effected by the solar wind. Solar wind is stream of charged particles from the Sun. The Earth's magnetic field diverts most of the particles but not all. Some get trapped in belts of radiation called the Van Allen Belts .