Of the light from the Sun that reaches the Earth, about 30% is reflected by the atmosphere and the surface of the Earth, about 20% is absorbed by the atmosphere (mainly in the thermosphere and stratosphere) and about 50% is absorbed by the surface of the Earth causing the surface to warm and emit infra red radiation.
Of the radiation emitted by the Earth's surface (which is mostly infra red), about 60% escapes to space whilst the remaining 40% is absorbed by the atmosphere (mostly in the troposphere) or reflected back to Earth.
Most of the infra red radiation absorbed in the atmosphere is absorbed by water vapour and carbon dioxide but about 5% is absorbed by ozone (O3) , nitrous oxide (N2O) and methane (CH4). Man-made emissions of various CFCs (chlorofluorocarbons) also absorb some infra red radiation.
Infra red radiation absorbed by the atmosphere is subsequently re-emitted and some of this radiation reaches the surface of the Earth keeping it about 33°C warmer than it would otherwise be (the greenhouse effect).