Edit*: problem solved. Thanks for the hint Dick.
Try the pythagorian theorem: x = sqrt(y^2 + z^2)
Since you can have any value on the x axis, the shortest distance will always be a straight line.
To see it better, draw out a triangle, where Z is the height, and Y is the lenght, leaving the distance X which will be the hypotenuse.
Draw it out, it'll make it clear.
EDIT: X,Y,Z in your case being points A,B,C
A point on the x-axis is given by (d,0,0) for some value of d. What value of d will minimize the distance to (a,b,c)?
Separate names with a comma.