Does the expansion of space cause light to lose energy, or is it the other way around? I am just starting Astronomy and have enjoyed reading about it. The expansion of space, the determination of the Hubble constant by looking at red-shifts, e.t.c. and it has made me wonder, is light red-shifted because of the expansion of space, or does light lose energy as a linear function of time which causes the expansion of space? I am not referring to Tired light but to photons losing energy based on how long it travels. 

Edit $1$ 
I meant that the light would not lose energy solely due to bumping into particles, but as a function of time, such as $hf_t=hf_0−xt$. Due to the law of conservation of energy, this would cause space to "gain" energy and expand. The more photons that travel through a patch in space, the faster it expands.
 A: Technically light does not looses energy because of space expansion, but because of light source (galaxy or something) is moving away from observer (another galaxy) at a speed $v$. This is so called Doppler effect :
$$f = \dfrac{2c -v}{2c +v}\cdot f_s$$
So light looses frequency $f$ (and energy $E=h \cdot f$) because wave front is spead-out when light has to catch a moving away observer. 
Note, that I haven't used here a Relativistic doppler effect, because light source can move away at far greater speeds than $c$. This doesn't contradict to special relativity, because actually not a galaxy moves away from an observer, but space itself expands at speed $v$ and thus "drags galaxies" with it together.
Also It can be seen from the formula, that in case of expansion speed $v>=2c$, photon frequency/energy drops to zero or starts being negative. This is not a a miracle, scientists call it cosmological event horizon, the phenomenon when at some far future photon frequency will be too small for us to detect so our sky at night will be almost dark with no any stars visible from other places except our own milky way galaxy.
A: Light does not loose energy at all.
The energy of light (or formulated differently: the color of light) depends on the reference frame that you use to measure it. The theory of relativity spells out the details. The reference frames which are most practical to use, are "moving with the flow" of matter in the homogeneous expanding universe. For example, a practical reference frame for ourselves is the frame which moves with our galaxy, our milky way.
The crucial thing is that reference frames that "move with the flow" in different places, move with respect to each other. This makes a value measured for energy or color different for different reference frames. When a ray of light is emitted from somewhere in the universe, it makes sense to express its energy / color in the reference frame of the local matter around it at the event of emission. And when the same ray of light is absorbed, the reference frame of the local matter around it at the event of absorption. The apparent loss of energy is an artifact of using different reference frames.
If we always expressed the energy of the ray in the same reference frame, there would be no change in energy. But such a reference frame would not be very practical to use for the universe as a whole: some parts of of the universe would be at rest in it, other parts moving, so it could lead to the wrong idea that the universe is not homogeneous.
It would all be the easier if we could have a reference frame that (1) is an inertial reference frame, so measurements yield the same everywhere, every time, and (2) moves with the flow of the universe. But the particular motion (the expansion) of the universe makes that combination impossible.
