Resources · Education
What Is a Ray in Math?
A ray is part of a line that starts at one point, called the endpoint, and continues forever in one direction. One endpoint is the whole distinction: a line has none and a segment has two. This guide covers the definition, ray against line and line segment, how to name one and why ray AB and ray BA are different, and worked examples from angles to number-line inequalities.
6 min read
What is a ray in math?
A ray is part of a line that starts at one point and continues forever in one direction. It has a beginning and no end.
The starting point is called the endpoint, and a ray has exactly one of them. That single fact is what separates a ray from the two things it is most often confused with: a line has no endpoints at all, and a segment has two.
•——————→
The dot marks the endpoint. The arrow says the ray keeps going. Both halves of that picture matter: drop the dot and you have drawn a line, drop the arrow and you have drawn a segment.
A beam of light from a torch is the usual everyday comparison, and it is a fair one. There is a definite place it starts and no definite place it stops.
Ray vs line vs line segment
Three objects, distinguished entirely by how many endpoints they have.
| Endpoints | Length | Written | Has a midpoint? | |
|---|---|---|---|---|
| Ray | 1 | Infinite | AB with one arrow | No |
| Line | 0 | Infinite | AB with two arrows | No |
| Line segment | 2 | Measurable | AB with a plain bar | Yes |
The midpoint column is the one worth dwelling on, because it makes the difference concrete rather than definitional. A midpoint is the point halfway between two ends, so it needs two ends to exist. A segment from (2, 3) to (8, 11) has a midpoint at (5, 7), found by averaging the coordinates. A ray has one endpoint and no second one, so there is nothing to average and no midpoint to find. The midpoint formula calculator will happily average any two points you give it, which is precisely why knowing what you are handing it matters, and the midpoint formula guide shows why averaging the coordinates is the right thing to do.
Length behaves the same way. A segment can be measured; a ray cannot, because one end never arrives.
How to name a ray, and why the order matters
A ray is named with two points: the endpoint first, then any other point it passes through. The notation is the two letters with a single arrow above them, pointing right.
- Write the endpoint first. Always. It is the part of the name that carries information.
- Write any second point on the ray. It says which direction the ray travels.
- Draw the arrow above both letters, pointing right, regardless of which way the ray points on the page.
Ray AB and ray BA are different rays. Ray AB starts at A and travels through B and onwards. Ray BA starts at B and travels through A in the opposite direction. They overlap on the stretch between A and B and share nothing else.
This is the opposite of how lines and segments behave. Line AB and line BA are the same line; segment AB and segment BA are the same segment. Only the ray cares about the order, because only the ray has a distinguished starting end.
Worked examples
Three settings where the word does real work.
- An angle is two rays. Every angle is formed by two rays sharing an endpoint, and that shared endpoint is the vertex. The size of the angle is how far apart the rays open. The reference angle calculator works with the angle those two rays make.
- Opposite rays make a line. Two rays from the same endpoint pointing in exactly opposite directions form a straight line, and the angle between them is 180°. This is why a straight angle measures 180 rather than being a special case.
- A number line inequality is a ray. The solution set of x ≥ 0 starts at 0 and runs forever to the right. Written in interval notation it is [0, ∞), and the square bracket against the round one is the same distinction as the dot against the arrow.
That third example is where the idea reappears after geometry class. Any inequality with one bound and one open direction describes a ray on the number line, whatever the subject calls it.
Where rays turn up outside geometry
- Light. A ray of light is the original metaphor, and optics keeps the word: ray diagrams trace one starting point and one direction through lenses and mirrors.
- Computer graphics. Ray tracing sends a ray from the camera through each pixel and follows it until it hits something. The mathematics is exactly the geometric object: one origin, one direction, no end.
- Bearings and navigation. A bearing from a fixed position is a ray. It says where you start and which way you face, and says nothing about how far.
- Sunrise and shadow problems. The sun’s rays are treated as parallel rays in trigonometry questions, which is what lets a single angle describe every shadow in the scene.
The common thread is that a ray is the right object whenever where it starts and which way it goes matter but how far does not.
Common mistakes
- Naming the ray backwards. The endpoint goes first. Ray AB and ray BA are different objects.
- Trying to measure a ray. It has infinite length; only the segment between two named points on it can be measured.
- Looking for a midpoint. A midpoint needs two ends. A ray has one.
- Drawing two arrowheads. That is a line. One dot and one arrow is a ray.
- Confusing a ray with a vector. Both have a direction, but a vector also has a magnitude and no fixed position, while a ray has a fixed starting point and no magnitude at all. A translation is where the vector does the work: it slides the whole ray, endpoint and all.
Quick summary
- A ray has one endpoint and continues forever in one direction.
- Line: no endpoints. Ray: one. Segment: two.
- Name a ray endpoint-first; ray AB and ray BA are different.
- A ray has no length and no midpoint, because it has no second end.
- Two rays sharing an endpoint form an angle; opposite rays form a 180° line.
- On a number line, x ≥ 0 is the ray [0, ∞).
The midpoint formula calculator finds the point halfway along a segment, which is the operation a ray cannot support, and the reference angle calculator works with the angle two rays make.




