The nematode Caenorhabditis elegans migrates toward a preferred temperature on a thermal gradient. A candidate neural network for thermotaxis in C. elegans has been identified, but the behavioral strategy implemented by this network is poorly understood. In this study, we tested whether thermal migration is achieved by modulating the probability of turning behavior, as in C. elegans chemotaxis. This was done by subjecting unrestrained wild-type, cryophilic, or thermophilic worms to rapid spatially uniform temperature steps (3 degrees C), up or down from the cultivation temperature. Each of the three types of worms we analyzed showed a different pair of responses to the two types of steps. Comparison of wild-type and mutant response patterns suggested a model in which thermal migration involves a unique response to the gradient depending on the orientation of the worm relative to its preferred temperature. Overall, however, turning probability was modulated in a manner consistent with a role for turning behavior in thermal migration. Our results suggest that sensory systems for thermotaxis and chemotaxis may converge on a common behavioral mechanism.