A new simple, general and rigorous analytic expression for the equilibrium activity coefficients of electrons and holes in degenerate semiconductors with nonuniform composition is presented. These activity coefficients are functions of the carrier degeneracy (Fermi-Dirac statistics), the band gap, the electron affinity and the density of states which vary with position. The calculation of carrier activity coefficients requires the selection of chemical potential and electrostatic potential references. The choice of these reference states is addressed. The relationships between purely thermodynamic quantities and parameters of the band theory are also presented. Emphasis is also placed on formulating an equation in a simple, Boltzmann-like form in which the nonideal behavior is described by two parameters, the effective band-gap shrinkage, ΔE g, and the effective asymmetry factor, A. In this form the working equations for the carrier densities and activity coefficients are convenient for use in computer-aided analysis and design. The approach presented here allows convenient treatment of nonuniform degenerate semiconductors in a manner that is consistent with thermodynamics as well as with the Poisson-Boltzmann equation for the electrostatic potential.