When you think about how gravity affects light you really need to think in terms of general relativity, which describes gravity as the effect of a curved space-time on moving particles. Summarized by John Wheeler, mass tells space how to curve and space-time tells mass how to move.
When we apply this to light we start with the fact that light travels in straight lines (null geodesics). However when we have a large mass (say the Sun) it curves space around it, so our light ray will follow a straight line in this curved space-time. This path will appear bent to us and leads to the phenomena of gravitational lensing.
As an aside, this also easily answers the question of why all masses fall at the same rate (or gravitational mass equals inertial mass). Massive particles also follow geodesics (straight lines) in this curved space-time, so if I throw two objects of different masses with the same initial velocity they will follow the same geodesic through space-time, and we see this as both objects having the same acceleration.