What Is the Difference Between a Ray and a Line?

A line extends infinitely in both directions with no endpoints, while a ray starts at one point and extends infinitely in only one direction. That single difference, the number of endpoints, is the core distinction between these two fundamental shapes in geometry.

What a Line Is

A line is a straight path that goes on forever in both directions. It has no starting point and no stopping point. You can always extend it further in either direction, which means it has no measurable length. Think of the horizon stretching endlessly to your left and right.

In diagrams, a line is drawn with an arrowhead on each end to show that it continues in both directions. You name a line using any two points that sit on it. If those points are A and B, you write it as AB with a small double-headed arrow above the letters (↔). The order of the letters doesn’t matter because neither point is special: AB and BA describe the same line.

What a Ray Is

A ray starts at a fixed point and travels forever in one direction. That fixed starting point is called the endpoint (sometimes called the vertex). From there, the ray passes through a second point and keeps going infinitely. A beam of sunlight is the classic real-world example: it originates at the sun and shoots outward without end.

In diagrams, a ray has a dot on one end and a single arrowhead on the other. You name a ray by listing the endpoint first, then any other point along it. So ray AB (written with a single right-pointing arrow above the letters, →) starts at A and passes through B. Here, order matters: ray AB and ray BA are not the same thing, because they start at different points and can point in completely different directions.

Side-by-Side Comparison

  • Endpoints: A line has zero. A ray has exactly one.
  • Direction: A line extends in two opposite directions. A ray extends in only one.
  • Length: Both are infinitely long, but a line is infinite on two sides while a ray is infinite on one side only.
  • Notation: A line uses a double-headed arrow (↔) above two points. A ray uses a single arrow (→), always starting from the endpoint.
  • Diagram clue: Two arrowheads means line. One dot and one arrowhead means ray.

How Line Segments Fit In

A line segment is the third member of this family and helps clarify the pattern. A segment has two endpoints and a fixed, measurable length. It doesn’t extend at all. So the progression is straightforward: a segment has two endpoints, a ray has one, and a line has none. Each step removes an endpoint and adds infinite extension in that direction.

Opposite Rays Form a Line

Two rays that share the same endpoint and point in exactly opposite directions combine to form a line. These are called opposite rays. If point Q sits between points A and B on a straight path, then ray QA and ray QB are opposite rays. Together they cover every point on line AB. This is a useful concept because it shows the relationship between rays and lines: a line can always be split into two opposite rays, and two opposite rays always create a line.

How They Work in Coordinate Geometry

On a coordinate plane, a line can be described by an equation like y = mx + b, where m is the slope and b is where the line crosses the y-axis. That equation has no restrictions on x, so it stretches infinitely in both directions.

A ray uses the same kind of equation but with a restriction. If a ray starts at point (2, 3) and extends to the right, you would write the same linear equation but specify that x must be greater than or equal to 2. That domain restriction is what turns an infinite line into a ray on a graph. You can also define a ray by giving its endpoint and one other point it passes through, which establishes both its starting location and its direction.

Spotting Them in Diagrams

The fastest way to tell them apart on paper is to look at the ends. Count the arrowheads and dots. Two arrowheads, no dots: that’s a line. One arrowhead and one dot: that’s a ray, starting at the dot. Two dots and no arrowheads: that’s a line segment. This visual shorthand is consistent across textbooks, standardized tests, and online math tools, so once you learn it, identification becomes automatic.