Why can light (photons) bends in a curve through space without mass? I've heard that light can form a curve if they travel near high-mass stars or even a black hole with strong gravity. Which is according to this Newtonian formula
$$\large F_{g}=\dfrac{Gm_1m_2}{r^2}.$$
But I've also heard that photons do not have (rest) mass! So it doesn't fit that equation anymore! But why can photons be pulled by gravities without (rest) mass? Could someone explain that?
 A: Your logic is ultimately wrong because that equation doesn't reveal the true nature of gravity.
According to general relativity, objects themselves bend space-time.

Imagine space like a rubber sheet. If you stretch it and place a mass in the middle and roll a ping-pong ball past the mass, it will curve towards the mass. Similarly when space-time is being curved, any object, whether it has mass or not, will appear to be attracted towards mass. But from the perspective of the object, it's going in a straight line.
Weird things happen at velocities at or near $C$. While a photon has no mass, it does have momentum and energy.
A: Ah, all that talk about curved space-time. Well, there is a simpler argument.
The fundamental axiom of general theory of relativity, "principle of equivalence", says:

The effect of a homogeneous gravitational field is equivalent to that of a reference frame in uniform acceleration in the direction opposite to that of the gravitational field.

All that complex stuff about curved time-space is derived from this, but we won't need any of that, because we can make simple argument directly from this axiom. 
In an inertial frame of reference, light moves in straight line. Now if you observe it from accelerating reference frame, you will obviously see it accelerating in the opposite direction along with any other objects. And since gravity has the same effect as accelerating reference frame, light has to be subject to gravitational acceleration along with everything else.
A: In Newtons theory of gravity photons are not affected by gravity (created by masses). So your conclusion is correct.
But in General Relativity the curves of free objects like test particles or photons (geodesics) are determined by the space-time geometry. The geometry is described by the metric which is given by the energy and mass distribution of the universe (Einstein Equation). It is also important to note that you therefore don't need the notion of a force in General Relativity.
In short: Light is bent in a curve due to curved space-time.
A: Newton's formula is an approximation of how "gravity really works". 
We actually still don't know how gravity really works, but we have vastly refined our understanding of it thanks to Einstein's general theory of relativity. 
Gravity is simply a measure of curvature of a 4-dimensional manifold we earthlings call space-time. Local concentrations of mass or energy cause the manifold, which is normally "flat" to curve in a 4D dent (hard to picture but easy to see in mathematical terms). We actually don't know WHY it bends, but we have measured the phenomenon with outstanding accuracy (which incidentally has proven the wrongness of Newton's laws as a fundamental explanation of natural phenomena - they are still useful for engineering purposes though so please do learn them). In other words, gravity is simply geometry.
Most of the "curvature" is along the time dimension, but some (1/300,000,000^2 in SI) is along the spatial dimension. Hence the bending of light rays - even if they have no mass, their trajectory follows the curvature component in "ordinary 3D space". And yes, this has been experimentally validated, so it's not just some math-based fantasy.
And by the way, there is really no such thing as "light rays" - that's another useful approximation of something we don't quite fully understand either :)
A: The equation you are mentioning is the gravitation force derived by Newton. This force doesn't apply to particles such as photons for two reasons:


*

*Photons are too small, and you can't use Newtonian physics to describe their properties.


*Photons travel too fast (their velocity is the speed of light) and at such a velocity Newtonian mechanics cannot be applied.

Newton's gravitation law is really useful to understand the motion of planets around the sun for example, or the motion of a pendulum. But as it comes to light and space one has to look at Einstein's theory of relativity in order to fully understand phenomena.
Einstein's general relativity theory is a way to explain gravitation (and Newton's gravitation law is another). The main idea is that the space-time is curved by the presence of mass. What we do know (and that is always true) is that photons travel in a straight line in a vacuum. A big mass, such as a black hole, may curve space-time so much that a straight line in space-time isn't straight anymore. When we look at photons in space, they seem to bend in a curve through space.
To summarize:


*

*Light can form a curve if it travels near a big mass.

*You are right, photons don't have mass.

*You are also right, photons doesn't follow Newton's gravitation law.

*Photons can be pulled by gravity not because of their mass (they have none) but because gravity bends space-time.


A: you are correct in your thinking,  because you are using newton's laws. However, newton's laws were not completely accurate. For circumstances like ones with photons and extreme gravity like black holes, you must use Einstein's general theory of relativity. These laws say that all particles follow the shortest path along spacetime, including photons. But without Einstein your thinking is perfectly logical.
