The Moon affects tides on Earth through gravity. The Sun also affects Earth's tides, but not as much due to its greater distance from the Earth. It's not the simple force of… attraction that makes the tides, but the difference in the attractive force on the opposite sides of the Earth.