Explanation:
Basically a line goes on forever in both directions. A ray only goes off forever in one direction. If we glue together two rays that point in complete opposite directions (eg 1 points north, the other points south) then we form a line.
A line segment is a piece of a line. It doesn't go on forever in either direction. It has 2 endpoints and has a set fixed length. If you know the coordinates of each endpoint, you can use the distance formula to find that length.