The change in frequency is given by:
where
= frequency observedIn the Special Theory of Relativity the speed of light is constant for all observers, and therefore the speed of a photon of light from a source that is moving towards or away from the observer is not affected by that relative motion.= frequency of source
= relative velocity
= speed of light
This is counter-intuitive, but the relativistic Doppler effect produces the effect that the frequency, and therefore energy, of the photons is affected: photons from any approaching source are increased in energy and photons from a receding source are reduced in energy: this is more intuitively satisfying. It is similar to the change in kinetic energy of an object due to the thing or person throwing it moving relative to the observer.
You can never "run alongside" a photon: this does not seem too unreasonable; but, what seems less reasonable, no matter how fast you chase a photon it is always moving away from you at exactly the same speed; but you do have the consolation that the photon appear to have less energy the faster you chase it; but it will never quite have zero energy.
In this article the term light is intended to mean any electromagnetic radiation, and any other particle that has no rest mass and which must always travel at the speed of light (when in a vacuum).
The article on electromagnetic radiation also gives the relationship between frequency and energy of a particle.