We combine the shear-transformation-zone (STZ) theory of amorphous plasticity with Edwards' statistical theory of granular materials to describe shear flow in a disordered system of thermalized hard spheres. The equations of motion for this system are developed within a statistical thermodynamic framework analogous to that which has been used in the analysis of molecular glasses. For hard spheres, the system volume V replaces the internal energy U as a function of entropy S in conventional statistical mechanics. In place of the effective temperature, the compactivity X=∂V/∂S characterizes the internal state of disorder. We derive the STZ equations of motion for a granular material accordingly, and predict the strain rate as a function of the ratio of the shear stress to the pressure for different values of a dimensionless, temperature-like variable near a jamming transition. We use a simplified version of our theory to interpret numerical simulations by Haxton, Schmiedeberg, and Liu, and in this way are able to obtain useful insights about internal rate factors and relations between jamming and glass transitions.