The formalism for rate and state friction is extended to represent fault zones where temperature, porosity, effective normal traction, and strain rate are functions of position (measured across the fault zone). A traditional form for the instantaneous coefficient of friction is retained, mu(0) + a ln(epsilon epsilon)+ b ln(psi/psi(0)) where mu(0) is the steady state coefficient of friction at shear strain rate epsilon(0), a and b are small constants, epsilon is the shear strain rate, psi is a state variable that represents damage, and psi(0) a normalizing factor. Percolation theory of cracked solids is used to justify a relation between Porosity and the state variable of psi = exp[(phi(0)-f)/C-epsilon], where c(epsilon) is a dimensionless constant, and phi(0) is the porosity at a reference steady state strain rate epsilon(0) and at a reference temperature where Delta=0 and a reference effective normal traction Delta P-0. These relationships and percolation theory imply an evolution law for porosity of the (normalized) form partial derivative f/partial derivative t = (Delta P-0(n) epsilon/C-eta(0)epsilon(0)) - (Delta P-n/C-eta(Delta T)psi) where t is time, Delta P is the effective normal traction, C, is a material property (related to compaction viscosity) that depends on the temperature difference Delta T from reference condition, 0 indicates reference conditions, and n is a power law rheology exponent. The first term represents creation of porosity by frictional dilatancy while the second term represents closure of porosity by compaction. The effects of transient changes of pressure and temperature on the coefficient of friction are represented when the normalizing factor psi(0) is Delta (PCeta)-C-n(O)/Delta (P0Ceta)-C-n(Delta T). The theory is complete in the sense that the complete earthquake cycle is represented and that there are no unmeasurable state parameters. The theory was applied to investigate earthquake quenching by fluid pressure decreases associated with frictional dilatancy and the related topic of strain localization and delocalization within fault zones. It was found that strain localization will occur when b >a. Such strain localization tends to destabilize sliding within drained faults by reducing the effective value of the critical displacement. Fault zones that sire hydraulically sealed from the country rock but internally hydraulically connected are also destabilized because strain localization reduces the fluid pressure decrease from frictional dilatancy. Two mechanisms that delocalize strain once sliding is well underway were investigated. Strain rate strengthening at high-strain rates leads to a high strain zone that gradually broadens throughout An increase in the coefficient of friction with temperature leads to a high strain rate zone that moves through the fault zone from hot regions created by frictional heating to cold regions.