As an explanation of why a large gravitational field (such as a black hole) can bend light, I have heard that light has momentum. This is given as a solution to the problem of only massive objects being affected by gravity. However, momentum is the product of mass and velocity, so, by this definition, massless photons cannot have momentum.

How can photons have momentum? 

How is this momentum defined (equations)?

There are two important concepts here that explain the influence of gravity on light (photons).

(In the equations below $p$ is momentum and $c$ is the speed of light, $299,792,458 \frac{m}{s}$.)


The theory of Special Relativity, proved in 1905 (or rather the 2nd paper of that year on the subject) gives an equation for the relativistic energy of a particle;

$$E^2 = (m_0 c^2)^2 + p^2 c^2$$

where $m_0$ is the rest mass of the particle (0 in the case of a photon). Hence this reduces to $E = pc$. Einstein also introduced the concept of relativistic mass (and the related mass-energy equivalence) in the same paper; we can then write

$$m c^2 = pc$$

where $m$ is the relativistic mass here, hence

$$m = p/c$$

In other words, a photon does have relativistic mass proportional to its momentum.
De Broglie's relation, an early result of quantum theory (specifically wave-particle duality), states that

$$\lambda = h / p$$

where $h$ is simply Planck's constant. This gives

$$p = h / \lambda$$


Hence combining the two results, we get

$$E / c^2 = m = \frac{p}{c} = \frac {h} {\lambda c}$$

again, paying attention to the fact that $m$ is relativistic mass.

And here we have it: photons have 'mass' inversely proportional to their wavelength! Then simply by Newton's theory of gravity, they have gravitational influence. (To dispel a potential source of confusion, Einstein specifically proved that relativistic mass is an extension/generalisation of Newtonian mass, so we should conceptually be able to treat the two the same.)

There are a few different ways of thinking about this phenomenon in any case, but I hope I've provided a fairly straightforward and apparent one. (One could go into general relativity for a full explanation, but I find this the best overview.)
