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.