A bacterial flagellum is driven at its base by a rotary motor comprising a rod and set of rings embedded in the cell wall and cytoplasmic membrane. The energy for rotation is supplied by an electrochemical proton gradient. The motor spins alternately clockwise and counterclockwise, with a bias depending on sensory transduction, for example, on the cell's response to chemical stimuli (chemotaxis). Studies of the biochemistry and physiology of this system are being made with Escherichia coli and a motile streptococcus. E. coli is being used, because the structure of its motors can be perturbed genetically. Streptococcus is being used, because its motors can be energized artificially. Measurements have been made, either with swimming cells or with cells tethered to glass by a flagellum, or protonmotive force, proton flux, torque and speed. Paralyzed mutants have been repaired by synthesis of wild-type protein encoded by genes carried on plasmids. This work had led to a model for the motor consistent with existing experimental data that is being subjected to further test. The goal is an understanding of flagellar rotation at the molecular level, or more broadly, of how living things use chemical energy to do mechanical work.