See the figure above. The point M is the midpoint of the line segment PQ. Only a line segment can have a midpoint. A line cannot since it goes on indefinitely in both directions, and so has no midpoint. A ray cannot because it has only one end, and hence no midpoint.
When a line cuts another line into two equal parts it is called a bisector. The bisector will cut the line at its midpoint. The midpoint of a line segment can be found using a compass and straightedge. See Constructing the perpendicular bisector of a line segment.