How to find the shortest distance from a line to a solid? The equation $x^2 + y^2 + z^2 - 2x + 6y - 4z + 5 = 0$ describes a sphere. Exactly
how close does the line given by $x = -1+t; y = -3-2t; z = 10+7t$ get to this sphere?
So the sphere is centered at $(1,-3,-2)$ and the radius is $3$. 
I want to find the point where the segment from the center to that point is perpendicular to the line, and then minus the radius to get the answer. So how can I find that point? Or how should I solve this problem in other ways?

Since you have a sphere, the problem is easy, as you propose.
The orthogonal projection of the center of the sphere $p=(1,-3,-2)$ onto the line $x=−1+t;y=−3−2t;z=10+7t$ can be found by translating both point and line so the line passes through $(0,0,0)$, taking the vector orthogonal projection, and translating back:
Let $r=(-1,-3,10)$, the point on the line for $t=0$.  The orthogonal projection of $p-r$ onto the line defined by the vector $s=(1,-2,7)$ (the multipliers of $t$ in the formula for the line) is given by $$\frac{(p-r)\cdot s}{s\cdot s}s.$$  So the closest point on the line is given by $$\frac{(p-r)\cdot s}{s\cdot s}s+r.$$  In your example this is $$\frac{(2,0,-12)\cdot(1,-2,7)}{(1,-2,7)\cdot(1,-2,7)}(1,-2,7)+(-1,-3,10)=\frac{2+0-84}{1+4+49}(1,-2,7)+(-1,-3,10),$$ which I think you can work out with no problem.
Then the distance is from this point to the center of the sphere, minus the radius.
