The warm Earth emits infrared radiation. Some gases absorb this radiation and re-emit it in all directions.