Line lenght

How to get line lenght/vector3, when i cast Ray with some direction and hit some collider (it dont have to be cube).

I want to calculate some float distance or Vector3 from input point (RaycastHit.point) to some output point
How can i do that ?
.

Do a raycast into the opposite direction against the Collider you already have the hit point for. The distance between both hit points is your length.

And when is something behind this object/collider ?
(idk how far i should use the backward ray)