g = (GM 1 m 2 )/D 2
Where M 1 and m 2 are the masses of the two objects and the separation (D) is measured between the centers of the two masses.
In other words, if the mass of the system increases (or decreases), the force of gravity between the two bodies changes in direct proportion. If you double the mass, you double the force. On the other hand, if the separation between the two bodies changes, the change in force is proportional to the inverse of the change in separation squared. In other words, take the change in relative distance, square it, then divide the original force value by this. If the separation doubles (2), then the inverse square is 1/2*2 or 1/4. Thus the value for the force would go down to one fourth the original value. Try plugging in some values to see what happens. (If the mass decreases by 1/2, use .5 and so on.):