Light responds to gravitation. Light has momentum. Given these two postulates it follows that if a photon passes a massive body both the photon and the body will be effected, though admittedly the effect on the massive body will be extremely slight. Put another way, a photon has its own gravitational field. Now a photon traveling through the universe is not going to travel in a straight line, it's course will be constantly altered by the gravitational fields it goes through. Since it is constantly changing directions it seems that some of its energy would be radiated away as gravitational waves. Since its velocity is fixed this would mean that it would shift to a lower energy frequency. The longer the photon traveled through the universe the more energy it would lose and the more red shifted it would become. How do we know that the red shift in light from distant stars is shifted due to the star moving away and not due to losing energy in the form of gravity waves?
The world-line of a test particle, such as a photon, is essentially the definition of a "straight" line in general relativity. A good introduction to this kind of thing is Relativity Simply Explained, by Martin Gardner.
By doing calculations. The lighter a particle is, the more does it resemble a massless "test particle", i.e. a hypothetical particle which doesn't affect spacetime at all. bcrowell is talking about such a test particle. Photons are already very light. The worst thing - in terms of acceleration - that can happen to a photon is to orbit around a small (~sun-sized) black hole. It's at the very least some 20 orders of magnitude worse than what happens to a photon in interstellar space. Even then, if the usual Quadrupole approximations still hold for a photon, they lose a significant amout of energy at a timescale of 10^60 s (for optical photons), which is ridiculously longer than the age of the universe. IOW: they behave like test particles and don't radiate gravitational waves.