moving particles give off electromagnetic energy, heat is usually considered to be infrared when it's in temperatures that humans are used to.
The particles in the atmosphere vibrate more when heated, this radiated energy goes in all directions, including back into space.
When they say heat rises, that doesn't mean that it's the only possible way for it to move, they just mean that here on earth, a hot air mass will rise above cold air masses b/c the hot one is less dense.
Heat can radiate regardless of any gravitational well. (unless it's a black hole of course)