Ray
A ray is a part of a line that has one endpoint and extends infinitely in one direction.
Definition
A ray starts at one endpoint and goes on forever in one direction, like a ray of sunlight starting at the sun and continuing outward; we draw an arrow only on the end that never stops. Formally, a ray is a subset of a line starting at a fixed endpoint and extending infinitely in one direction: ray $AB$ starts at $A$, passes through $B$, and continues beyond $B$ without end. From point $A$ through point $B$ in $\mathbb{R}^n$, this is the set $\{A + t(B - A) : t \ge 0\}$, a half-line formed by translating the non-negative real half-line into the ambient space.
Example
A flashlight beam is like a ray, starting at the flashlight and going on indefinitely in one direction. Ray $AB$ and ray $BA$ are different: ray $AB$ starts at $A$ and goes through $B$, while ray $BA$ starts at $B$ and goes through $A$, pointing in opposite directions, and two opposite rays together form a straight line. In $\mathbb{R}^2$, the ray from the origin in direction $(\cos\theta, \sin\theta)$ is $\{(t\cos\theta, t\sin\theta) : t \ge 0\}$, the basis for polar coordinates.
Key Insight
Rays are essential for understanding angles: an angle is formed by two rays sharing the same starting point, the vertex, so you literally need rays to describe what an angle is. In complex analysis, a ray from the origin in the complex plane corresponds to fixing the argument (angle) of a complex number, connecting this simple geometric idea to analytic functions.