Redshifting of light from a moving light source We know that the expansion of space causes redshifting of light. I even read somewhere that the Doppler effect also happens in light. So imagine I switch on the headlights of my car in front of a wall. Now I reverse the car at a very high speed. Just assume that the road behind me is endless and straight and the headlight is very powerful. Now when I reverse my car, theoretically it will result in the redshifting of light. I understand the Doppler effect in sound but I just do not understand how is it possible with light. I mean if a wave of photons has already left the headlight then how will the movement of the car affect the wave.
And just another question, if you somehow manage to get the headlights flicker (i.e. stop and start again) very fast, then will there be any redshift?
[Edit]Addition to the question
When the car moves backward, then only the distance between the car and the wall is increasing. How does that affect the energy of the light wave. I don't get that why should the motion of the car affect its wavelength. In the case of sound it is understandable because sound requires a medium to travel. Light can travel in vacuum as well. Please correct me and tell me where I am wrong.
 A: JeffDror's answer is correct. I just want to give a more conceptual answer that's easy to visualize.
We all know that light is a wave, when you turn on your headlights and drive in reverse, the light is doppler shifted because of the motion of source. When not moving, each cycle of the light wave is emitted from the same position; it has a specific set of wavelengths. The distance between one crest of a wave and the next crest is equal to the speed of light, c, times the period of the light (which is determined by the oscillations in your headlights and won't change when you are in motion). When you drive backwards, the distance between one crest and the next becomes the period times c plus the period times your backwards velocity (approximately); the second crest is not emitted at the same location as the first, so it extends the wavelength. From your perspective, the emitted wave would not be red-shifted at all, but from a stationary observer's perspective it is. Once the light hits the brick wall, then you would see a red-shift because the brick wall reflects the light back to you but in your frame, the wall is moving away from you so light from it is red shifted.
Once the light has left the car, the movement of the car will not affect it. The red-shift takes place as the light is emitted/reflected from the car/wall.
A: The point is that when the photon leaves the headlight it is in a moving frame with respect to the lab frame and it has a give frequency. But the energy (and hence the frequency) is not a Lorentz invariant quantity. When we go to the rest frame, the photon frequency changes and we get a Doppler shift. 
More intuitively, what is happening is that the photon is leaving the headlight with speed $c$, but the headlight is already moving at a certain speed. In order for the speed to remain at $c$ the frequency of oscillation must increase. 
For more details see my recent answer to a similar question.
With regards to flickering the headlight. Everything will be the same. All that matters is that headlight is moving, not when it turned on. The light will still be Doppler shifted.
