Although vertebrate hindbrains are segmented structures, the functional significance of the segmentation is unknown. In zebrafish, the hindbrain segments contain serially repeated classes of individually identifiable neurons. We took advantage of the transparency of larval zebrafish and used confocal calcium imaging in the intact fish to study the activity of one set of individually identified, serially homologous reticulospinal cells (the Mauthner cell, MID2cm, and MID3cm) during behavior. Behavioral studies predicted that differential activity in this set of serially homologous neurons might serve to control the directionality of the escape behavior that fish use to avoid predators. We found that the serially homologous cells are indeed activated during escapes and that the combination of cells activated depends upon the location of the sensory stimulus used to elicit the escape. The patterns of activation we observed were exactly those predicted by behavioral studies. The data suggest that duplication of ancestral hindbrain segments, and subsequent functional diversification, resulted in sets of related neurons whose activity patterns create behavioral variability.