The earth attracts the moon with an equal force with which the moon attracts the earth but these forces are in opposite directions.
By universal law of gravitation, the force between the moon and the sun will be:
F = (G m1 m2/d2)
Where m1= mass of earth
m2 = mass of the moon
d = distance between the earth and moon.
According to the universal law of gravitation, every object in the universe attracts every other object by the force of attraction which is directly proportional to the product of masses of the objects and is inversely proportional to the square of the distance between them. The universal law of gravitation is responsible for the motion of all the planets around the sun, responsible for the motion of the moon around the earth.