Help needed for raycasting

I was trying to ray cast from a point inside a object and just make the shortest ray path that is going through the object visible. Any example code or any sources/lectures/lessons ? . What I am trying to do: