Newton's law of gravity in its familiar form gives the gravitational force between two point mass objects (or two uniform spheres which act as point objects). However, it can be cast in a form that handles non-spherical masses. Just treat a non-spherical mass as a collection of integration volumes, each behaving as a point mass, and integrate over the volume.
Newton's Law in full fixed-coordinate vector form:
F= - G m m' (x - x')/|x - x'|3
where F is the gravitational force of mass m' on m located at x' and x respectively. If another massive body m'' is introduced, it's force on m is just additive:
F= - G m m' (x - x')/|x - x'|3 - G m m'' (x - x'')/|x - x''|3
If we bring many point masses into the picture, we just add up all the forces:
F= - G m Ʃ mi(x - xi)/|x - xi|3
In the limit that the point masses get so packed together that they can be treated as constituting a spatial continuum of mass, the sum becomes a volume integral:
F= - G m ∫ ρ(x')(x - x')/|x - x'|3 d(3) x'
where ρ is the mass density. This is what you would use for extended non-spherical mass objects.