We have developed a powerful experimental framework that combines competitive selection and microarray-based genetic footprinting to comprehensively reveal the genetic basis of bacterial behaviors. Application of this method to Escherichia coli motility identifies 95% of the known flagellar and chemotaxis genes, and reveals three dozen novel loci that, to varying degrees and through diverse mechanisms, affect motility. To probe the network context in which these genes function, we developed a method that uncovers genome-wide epistatic interactions through comprehensive analyses of double-mutant phenotypes. This allows us to place the novel genes within the context of signaling and regulatory networks, including the Rcs phosphorelay pathway and the cyclic di-GMP second-messenger system. This unifying framework enables sensitive and comprehensive genetic characterization of complex behaviors across the microbial biosphere.