If photons have no mass, how can they have momentum? 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)?
 A: The reason why the path of photons is bent is that the space in which they travel is distorted. The photons follow the shortest possible path (called a geodesic) in bent space. When the space is not bent, or flat, then the shortest possible path is a straight line. When the space is bent with some spherical curvature, the shortest possible path lies actually on an equatorial circumference.
Note, this is in General Relativity. In Newtonian gravitation, photons travel in straight lines.

We can associate a momentum of a photon with the De Broglie's relation 
$$p=\frac{h}{\lambda}$$
where $h$ is Planck's constant and $\lambda$ is the wavelength of the photon.
This also allows us to associate a mass:
$$m=p/c=h/(\lambda c)$$
If we plug in this mass into the Newtonian gravitational formula, however, the result is not compatible with what is actually measured by experimentation.
A: If Newton's gravitation could define the bending of light by gravity, then the general relativity wouldn't have come up. Photons don't have mass and it's clear from the fact that it travels at the speed of light. Gravity is an illusion that seems to attract things but in fact it bends spacetime; which is why a straight path seems curved.  Newton's law of gravitation is still used because it's simple and we seldom encounter such massive objects like black holes in practical life, for which it does not hold.
A: In my opinion it is not necessary to evoke the theory of relativity or quantum physics to explain how light can have momentum but not mass. In the 19th century, it was already known that light can collide with matter; a beam of light can set a small wheel (in vacuum) rotating.
The key parameter for the study of collisions under classical mechanics is the momentum :
$$q= mv$$
(Momentum always being conserved in an isolated system)
The natural question is:
Can the principle of conservation of the momentum be extended to electromagnetic radiations also?
From experience you know that the answer is positive, provided you define the momentum of light as
$$q = \frac{L}{c}$$
Where $L$ is the energy of light and $c$ the light speed.
Can you extend the analogy assuming that light has mass too?
The assumption is reasonable. In case of positive answer, you get the Einstein equation
$$m = \frac{L}{c^2}$$
However you are not allowed to make such extensions since in Physics you must stick to the experimental evidences. There is no evidence that light has also mass.   
If so, how do you solve this paradox?
The light momentum and the momentum of a material particle are not the same thing. 
A: The answer to this question is simple and requires only SR, not GR or quantum mechanics.
In units with $c=1$, we have $m^2=E^2-p^2$, where $m$ is the invariant mass, $E$ is the mass-energy, and $p$ is the momentum. In terms of logical foundations, there is a variety of ways to demonstrate this. One route starts with Einstein's 1905 paper "Does the inertia of a body depend upon its energy-content?" Another method is to start from the fact that a valid conservation law has to use a tensor, and show that the energy-momentum four-vector is the only tensor that goes over to Newtonian mechanics in the appropriate limit.
Once $m^2=E^2-p^2$ is established, it follows trivially that for a photon, with $m=0$, $E=|p|$, i.e., $p=E/c$ in units with $c \ne 1$.
A lot of the confusion on this topic seems to arise from people assuming that $p=m\gamma v$ should be the definition of momentum. It really isn't an appropriate definition of momentum, because in the case of $m=0$ and $v=c$, it gives an indeterminate form. The indeterminate form can, however, be evaluated as a limit in which $m$ approaches 0 and $E=m\gamma c^2$ is held fixed. The result is again $p=E/c$.
A: 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.)
A: 
"momentum is the product of mass and velocity, so, by this definition, massless photons cannot have momentum"

This reasoning does not hold. Momentum is the product of energy and velocity. 

"How is this momentum defined (equations)?"

Inserting factors of $c$, the relativistically correct relation between momentum $p$ and velocity $v$ is $$c^2 p = E v$$ This holds for non-relativistic massive particles (total energy dominated by rest-energy: $E = m c^2$, and therefore $p=mv$) as well as for massless particles like photons ($v = c$ and hence $p=E/c$). 
A: Something that hasn't been mentioned is the concept of electromagnetic momentum and the Poynting vector.
The Poynting vector is defined as $${\bf S} = \frac{1}{\mu_0}\,{\bf E}\times{\bf B} $$
and "depicts the direction and rate of transfer of energy, that is power, due to electromagnetic fields in a region of space which may or may not be empty" and if energy is being transferred this suggests a momentum flow.
A useful video for you that goes into greater detail is due to Fermilab.
A: "How can photons have momentum?" (if they do not have mass)
How is this momentum defined (equations)?"
Wikipedia on momentum says:
"In Newtonian mechanics, momentum (...) is the
product of the mass and velocity
of an object."
p=mv
Interestingly, Wikipedia does not mention,in that context,  the De-Broglie wavelength equation which defines momentum alternatively as:
p=h/λ
Both equations put in one give mv = h/λ, which shows that p (momentum) is not derived from mass alone. One and the same momentum may come  from masses of different velocities or, different from that, from different waves of different lengths. Momentum (and energy) unifies both causes in one and the same effect.
It's an empirical finding that photons have momentum which is being made use of by the solar sail, for instance, and it is a definition of terms to say that photons have "mass", if this is some other way to express the equivalency of both formulas above. To be precise, photons are not said to have mass, they are said to have "rest mass" zero and they are said to have "relativistic mass".
Both terms are intricate, and the following remarks might not explain:
Rest mass as a term literally refers to weights put on both sides of a scale: masses are weighted "at rest" to each other. However, the unit of mass is "kg", and mass is measured by acceleration, by gravitational acceleration (of the earth). Thus, photons' rest mass is considered zero as particles that live at speed of light cannot be accelerated: there do not own "mass" because they cannot be gauged one against another. A particle of wavelength x cannot be put on scales  against particle of wavelength y. The term "rest" in fact, in my opinin, may be considered misleading, as it is earth's acceleration, thus "speed not rest" that is being measured. If this is understood it becomes clear that photons which have speed of light cannot be accelerated. The speed of light separates the realm of mass (in strict sens) from the realm of waves. Waves differ in frequency, not velocity, Masses differ in velocity, not frequency.  As photons cannot be gauged by different velocities they gain by gravitational (and inertial) acceleartion, they are said to have "rest" mass zero.
On the other hand, there is the term "relativistic" mass. This term is opposed to "rest mass" which is no trivial knowledge, it is just the opposite.
Relativistic mass is a term to acknowledge that restmassless photons do have mass in the form of "relativistic mass" as they own momentum (solar sail impulse) just like Newtonian masses have. It is a mode of putting it.
How can photons have momentum if they do not have mass?
The de Broglie formula shows that mass is not a  prerequisite for momentum.
This formula is based on empirical findings; there is no "reason why".
To reconcile these findings with Newtonian formula photons are said to have "rest mass" zero (no accelaration to variation in speed) on one hand, and on the other hand, they are said to have "relativistic" mass (in that sense they do have mass(!)) as they exert mechanical momentum (do not only transfer energy).
A: Of course they have mass. When saying "photons have no mass" in LHC rap, they were referring to the rest mass, it just didn't rhyme. 
(If you pack a bunch of photons into your mirror-coated box, it will be heavier, by $E/c^2$ as usual)  
A: This is a fundamental question requiring fundamental thinking. I shall keep away from theories and concentrate on simple facts. From the day we knew of the Brownian motion and realizing that particles of matter are on a continuous motion and not at rest, we should have realized that motion and not rest is the true influential variable of nature. Velocity should therefore be adopted as the prime variable we use to study nature. But velocity has the units of space and time locked in an inseparable format, we should then conclude that space-time is a the variable that need to be considered in our scientific endeavor. But velocity of particles have to involve mass too. This then says that the most fundamental variable of nature is momentum with the units of mass, space and time locked together. As particles possess electrical charges too, we should also add electrical charge unit to get to the fundamental variable of nature. 
When we look round we see that E.M radiation has all the above attributes. It has mechanical attributes in the form of energy and momentum flowing along the direction of propagation. This is given by the pointing vector P=E^H. Radiation also have electrical and magnetic attributes in its electric and magnetic fields that are normal to each other and normal to the direction of propagation. These attributes are all verifiable experimentally in the lab by simply directing a beam of radiation onto neutral and charged objects to see them move according to the laws of mechanics and electrodynamics.
That radiation is the fundamental ingredient of nature is supported by astronomical observations- which showed that radiation is all that is there at the start of the life of our universe. It is also supported by experiments in the lab wherein pure radiation(gamma rays) can produce matter, and pure matter(anti matter included) can produce pure radiation. The process is fully reversible and indefinitely. We can thus say that radiation could be considered as evaporated matter and matter as condensed radiation. If radiation condenses by going round (at the same speed) in closed loops, we get trapped radiaton, or rest energy or rest mass as a result. The circulation of the momentum produces the intrinsic spin, and that of the electric field(radial direction) creates the electric charge(Gauss theorem). The magnetic field vector is normal to the other two- producing the magnetic dipole moment along the spin direction. This completes all the required matter attributes- emerging as a result of radiation condensing into matter- thus supporting the radiation origin of matter.
Hence, momentum linear or angular is a defining property of our universe, be it in the form of energy or matter. As to why light bends round massive objects, we note that gravity also emerges when radiation condenses into matter. The key idea here is conservation of momentum. This is a fundamental property of our space and an experimental fact. Even elementary particles and radiation can't afford violating this principle. But if momentum is conserved, the forces between any two isolated particles locked in an orbit must be of the inverse square type as given in Bertrand theorem. Actually the theorem allows a spring type force(Hook's spring force) too, but this can be shown to be a limiting case of the inverse square force. Thus Newton's law of gravity and Coulomb's law of static interactions emerge as radiation condenses into matter. 
Now, the formula for the bending of a projectile in the vicinity of a massive object in the Newton's theory(the inverse square force theory) have only the speed of the projectile in it, and not its mass. The mass simply cancel's out. According to this fact, Newton proceeded to calculate the deflection of light caused by the sun for example. As it happened, Einstein calculated the same angle and found it to be double that of Newton. People without deeper thinking announced that this meant that Newton's formula is wrong and the whole theory should therefore be discarded- despite the fact that the mass of the sun is not that of a black hole to merit a big modification of the Newton's theory. It turned out that Newton's calculation gives the actual angle of light deflection, whereas what we measure is twice that value due to the symmetry of the problem as shown clearly here; https://file.scirp.org/pdf/JMP_2017102615295175.pdf. The rays that are drawn straight from the source to the sun surface can't cross to the other side- they hit the Sun's surface instead. What we see is rays that come from an angle equal to that after crossing the Sun's surface. The two results support each other in a sense.    
