Radiation is the primary way that heat travels in space. That means that heat is not spread out through the medium it travels through as on Earth. On Earth on a sunny day, the heat radiating from the Sun warms the molecules of the atmosphere, and they warm other molecules and they warm others in turn. That conduction is what keeps the Earth warm at night when we aren't receiving direct Sun rays. It also means that even when we are standing in shadow, the air around us has some warmth. On Earth, heat also travels in large density-driven convection loops that spread out the warmth. In space, heat can only exist where the heat waves are traveling. This is one reason why there is a huge temperature difference between Sun and shadow in space.