A ray with an endpoint extends infinitely in one direction and can extend in the opposite direction.
A line segment has two endpoints and cannot be extended, but it can be extended in two directions. A line segment has a length, and the line segment between two points is the shortest.