Aerotaxis is a particular form of “energy taxis”. It is based on a largely elusive signal transduction machinery. In aerotaxis, oxygen dissolved in water plays the role of both attractant (at moderate concentrations) and repellent (at high and low concentrations). Cells swimming from favorable oxygen concentrations into regions with unfavorable concentrations increase the frequency of reversals, turn back into the favorable domain, and become effectively trapped there. At the same time, bacteria consume oxygen, creating an oxygen gradient. This behavior leads to a pattern formation phenomenon: bacteria self-organize into a dense band at a certain distance from the air-water interface. We incorporate experimental observations of the aerotactic bacterium, Azospirillum brasilense, into a mathematical model. The model consists of a system of differential equations describing swimming bacterial cells and diffusing oxygen. The cells’ frequency of reversals depends on the concentration of oxygen and its time derivative while oxygen is depleted by the bacteria. We suggest a hypothetical model of energy sensing mediated by aerotactic receptors Aer and Tsr. Computer simulations and analysis of the model equations allow comparisons of theoretical and experimental results and provide insight into the mechanisms of bacterial pattern formation and underlying signal transduction machinery. We make testable predictions about position and density of the bacterial band.