F=GmM/r^2 where m is the mass of the earth, M is the mass of the sun, G is a constant, and r is the distance between the earth and the sun. This is exerted on the sun and the earth in the same magnitude and opposite direction.
For the earth's motion: F=ma. Thus: ma=GmM/r^2 --> a=GM/r^2, so...