Ray tracing computes the colour of each pixel by following rays of light backwards, from the eye into the scene. The primary ray of a pixel starts at the eye and passes through the pixel; its colour is that of the nearest surface it meets. A shadow ray starts at a point of a surface and goes towards a light: if it meets a surface before the light, the point is in shadow.
raytrace.c writes. Shadows on the floor and on the spheres come from the shadow rays; the light is to the upper left.