Light near a black hole is a tricky topic, and comes under the umbrella of relativity rather than quantum physics. The path that light takes is unaffected by gravity. It is not "attracted" due to the dual nature - photons are boson particles which do not have mass, and hence are unaffected by gravity. However, Einstein's General Theory of Relativity states that massive objects, like planets and black holes, cause space-time itself to curve around the massive body. In particular, a black hole is a singularity in space-time which has an infinite curl at that point. Hence, while the light is moving straight in space, the space itself is bent, or rather, curved, which makes us think that light is affected by gravity.
Nudge me for further clarification if you have any more doubts.