In fishes, undulatory swimming is produced by sets of spinal interneurons constituting a central pattern generator (CPG). The CPG generates waves of muscle activity that travel from head to tail, which then bend the body into wave shapes that also travel from head to tail. In many fishes, the wavelengths of the neural and mechanical waves are different, resulting in a rostral-to-caudal gradient in phase lag between muscle activity and bending. The neural basis of this phase gradient was investigated in the lamprey spinal cord using an isolated in vitro preparation. Fictive swimming was induced using d-glutamate and the output of the CPG was measured using suction electrodes placed on the ventral roots. The spinal cord was bent sinusoidally at various points along its length. First, the ranges of entrainment were estimated. Middle segments were able to entrain to frequencies approximately twice as high as those at end segments. Next, phase lags between centers of ventral root bursts and the stimulus were determined. Two halves of the cycle were identified: stretching and shortening of the edge of spinal cord on the same side as the electrode. Stimuli at rostral segments tended to entrain segmental bursting at the beginning of the stretch phase, almost 50% out of phase with previously measured in vivo electromyography data. Stimuli at caudal segments, in contrast, entrained segments at the end of stretch and the beginning of shortening, approximately the same phase as in vivo data.