The "cooler body" is not heating up the "warmer body." To put it very simply, short-wave energy from the sun passes through the atmosphere and strikes the Earth, warming it. A small portion of that energy is then radiated back into the atmosphere as long-wave (infrared) radiation. As it moves back through the atmosphere, certain molecules of gasses (and water vapor) with atoms that are not tightly and symmetrically bound (O2, for example, as being one of those tight, symmetrical molecules) resonate in specific frequencies in response to the IR radiation — much as piano strings resonate if you hold down the pedal and sing into it. Those resonating molecules send that energy in all directions, with a certain portion of it heating the troposphere and thus the Earth and its oceans — if that effect didn't happen at all, the Earth would be about -15ºC. The problem now is that we're rapidly increasing the heat-trapping gasses, disturbing the delicate balance that keeps us warm enough to live.