How Do Massless Particles Experience Gravity?

When Newton first proposed the law of universal gravitation, it marked the very first time that we realized the same rule governing how objects fell on Earth also governed how they moved and attracted one another throughout the Universe. Objects fell to Earth because of gravity; Earth pulls itself into a spheroid because of gravity; moons orbit planets and planets orbit the Sun because of gravity; and so on to larger and larger scales. Newton’s law was simple but profound: objects with mass attract each other dependent only on their masses, distances, and the gravitational constant of the Universe. So how, then, do massless particles, like photons, experience gravity? That’s what Bret Hammers wants to know, asking:
Given the equation for gravity between two masses, and the fact that photons are massless, how is it possible for a mass (like a star or a black hole) to exert influence on said photon?
It’s a really good question, but one that our deepest understanding of gravity can answer. Let’s see how.