Space is black because the Universe is expanding.
But anyway - there aren't many particles between Earth and the Sun, and thus, not much to warm. When not in something's shadow they can get quite hot (the Sun's corona is, technically, some two million degrees).
The photons only excite something when they hit it. Ie, Earth or the Moon. You will still cook if you went flying off along Earth's orbit without protection (Earth's shadow is good) for long enough - even at this distance, the Sun still provides a lot of energy.