The elastic property of the field is responsible for both gravity and electromagnetic forces.
The details of gravity force equations for photons are in the link below.
https://zenodo.org/record/4541280#.YDq703lOnIW
“Equations of force between photons or photon and matter with mass”