I spent hours thinking and finding a way to do this.
Let's say I have a point $P(X_0,Y_0,Z_0)$ and a plane $(Ax+By+Cz+D = 0)$. I'm trying to project the point, P to the plane from the origin and get the distance between P and the projected point Q. Is there a way to find the distance rather than finding the projected point and then Euclidean distance?
I know, if the projection is along the normal of the plane, then the distance is
Distance $=\frac{AX_0+BY_0+CZ_0+D}{\sqrt{ A^2 +B^2 +C^2}}$
But how about along the ray.
Thanks in advance.

Assuming $P$ is not on the plane, $PH$ is the minimum distance between point $P$ and the plane (which is along the normal vector).
You know the unit normal vector to the plane is,
$ \displaystyle \hat n = \frac{1}{\sqrt{A^2 + B^2 + C^2}} (A, B, C)$
You also know the unit vector along $\vec {OP}$,
$\hat {p} = \frac{1}{\sqrt{x_0^2 + y_0^2 + z_0^2}} (x_0, y_0, z_0)$
Now using dot product you can find angle $\theta$ marked in the diagram,
$\cos\theta = |\hat {n} \cdot \hat p| $
Also, $|PQ| \cos\theta = |PH|$
You already know how to find $|PH|$ and you know $\cos\theta$.