When negotiating a narrow gap, honeybees tend to fly through the middle of the gap, balancing the distances to the boundary on either side. To investigate the basis of this "centering response," bees were trained to fly through a tunnel on their way to a feeding site and back, while their flight trajectories were filmed from above. The wall on either side carried a visual pattern. When the patterns were stationary vertical gratings, bees tended to fly through the middle of the tunnel, i.e. along its longitudinal axis. However, when one of the gratings was in motion, bees flying in the same direction as the moving grating tended to fly closer to it, while bees flying in the opposite direction tended to fly closer to the stationary grating. This demonstrates, directly and unequivocally, that flying bees estimate the distances of surfaces in terms of the apparent motion of their images. A series of further experiments revealed that the distance to the gratings is gauged in terms of their apparent angular speeds, and that the visual system of the bee is capable of measuring angular speed largely independently of the spatial period, intensity profile, or contrast of the grating. Thus, the motion-sensitive mechanisms mediating range perception appear to be qualitatively different from those that mediate the well-known optomotor response in insects, or those involved in motion detection and ocular tracking in man.