Rays and lines are used to determine collisions with primitives over distances. Both methods are very useful when dealing with moving objects.
We will discuss the merrits of both methods in their own chapters.