Make a point in a line follow an object
Use hooks.

Hooks will allow you to parent vertices (or control points in a curve)
to empties or vertices in other objects, so that the deformations are controlled by the parented element.

read the following links:

Attaching a curve by its endpoints to two spheres

Is it possible to assign a parent to a control point of a curve using animall?

How to make an object&#39;s vertex follow another object

How to make a wiggly animated curve?

Dotted line on curve?