Basically, you want to build a line through the center of the spheres and the point. Then you cross this line with the sphere, and you have a projection point.
In details:
Let p be the point, s center of the sphere and r radius, then x = s + r*(ps)/(norm(ps)) , where x is the point you are looking for. Implementation remains for you.
I agree that a spherical coordinate approach will work as well, but is more computationally complex. In the above formula, the only nontrivial operation is the square root of the norm.
source share