A very basic question (I hope this is the right place for it). A distant star emits, say, a high-energy x-ray. Due to expansion of space, this reaches us as visible light (say, red part of the spectrum). The light that reaches us has less energy per photon (E=h*nu) then the light emitted from the star. What happened to the difference? Where did the energy go?