The gravity of a massive body like the sun acts on the Earth to keep it in orbit.
(The gravity of a massive body like the sun; acts; on the Earth)
The gravity of a massive body like the sun
acts
on the Earth