A confusing question. Sigh. As Mohammad said, a bit unclear. I'd call that a bit of an understatement.
To me, my interpretation is that you have a point on the surface of a sphere, given in terms of latitude and longitude. Then given another point in space that is in general external to the sphere, you wish to find the two intersections of the line that passes through these two points and the sphere. You say that you want the path length through the sphere, so given those two intersection points, the Euclidean distance between them is trivial to compute.
I would suppose that if the point on the sphere is on the back side of the sphere, from the point you are viewing from, then you want to know the distance through the sphere along that line.
Is this your question? If so, then be more clear, because there are three people here who each have chosen totally different interpretations of your question. I'll bet if we looked, we could find another interpretation too.
So what is your question, really? BE CLEAR! While I think I have interpreted it correctly, I'm a bit unsure, since two others have gotten completely different conclusions about what you need. I know, they are wrong. Or maybe its just me.
If your question is what I have said it is, then the answer is simple, doable with pencil and paper, though I'd probably use symbolic tools because, well, I'm lazy.
The point on the surface of a sphere can be converted to cartesian coordinates. Assume it is centered at the origin. If not, then it is trivial to translate the entire problem. After all, in the end, what you want is a distance. So a simple translation has no affect on distance. In fact, translating the origin of the sphere to (0,0,0) only makes the problem both simpler and better posed numerically. Then write the equation of the sphere as a basic quadratic form.
The line through two points is simply written in a parametric form like this:
P(t) = P0*(1-t) + P1*t
= P0 + t*(P1 - P0)
where P0 and P1 are vectors, defined by the two points in question. So any point on the line is given for some value of t. When t = 0, we get the point P0. When t = 1, we get P1 out. A nice thing about this linear parametric form is that it is easy to know where a point lies along that line, simply by knowing the value of t. Sometimes this parametric form is known as a convex combination. So if t is between 0 and 1, then the point located is between P0 and P1. Negative values of t, or values of t greater than 1 also have easily interpreted meanings.
Now, while I could go through the algebra, I'd only bother to do so IF it were of interest. It is not that hard to be honest. (On the other hand, I've too often invested a serious amount of effort, only to find the question was not as I interpreted it. I won't do so here. At least, I won't do so until I know what the real question is, and if I have interpreted what you said correctly.)