Yep. Gravity effects photons. Here's a thought experiment from Einstein:
Suppose you have a block having mass $m$ at the top of a tower. Drop it.
It picks up speed due to gravity as it falls, gaining kinetic energy.
Now suppose there's some super efficient means of converting mass to energy at the bottom of the tower and the newly created photons were fired back at the source point. Once they arrived at the source point, we reconverted the photons back to mass and started over again.
If we assume no loss of energy on the way up, then we have the makings of a perpetual motion machine.
We have to lose energy on the way up which means we have a reduction in frequency. Because the product of frequency with wavelength is a constant, the speed of light, the reduction in one implies the increase in the other. So the wavelength of the photon increaesesincreases as it rises back to the top of the tower. This is a Red Shift.
More generally, gravity distorts space-time. Space itself is curved. Just as the shortest distance between two points on a globe is not a straight line, the shortest distance paths between two points in curved space time, i.e. in a gravitational field, is also not a straight line. The lines do not exist. So the path's of photons must change.