Habitat heterogeneity is understood to be a primary driver of taxonomic diversity in modern reefs, and is assumed to have acted similarly throughout the Phanerozoic history of reef-building. However, there is no established methodology to measure heterogeneity in fossil reefs, and the rock record presents many challenges to doing so, including issues of preservation, exposure, and time-averaging. Here, I present five quantitative and semiquantitative methods that can be applied to fossil reefs in order to characterize heterogeneity. These include the complexity and diversity of reef-builder morphotypes involved in reef construction, the number of distinct reef facies, the scale of relief the reef achieved in life, and a Structural Complexity Index (SCI) calculated using the dimensions of framework elements encountered along a transect. These metrics are applied to Ordovician and Pleistocene reefs, and biases of each metric are discussed in detail. These metrics are then applied to reefs across the middle-Paleozoic to assess how heterogeneity changed over the interval, as reefs became more diverse. Through this interval, reefs became larger, exhibiting greater relief, a wider array of reef-builder morphotypes, and a higher diversity of reef facies. The final chapter addresses the identity of a cohesive reef fauna in deep time, using reef crises as natural experiments to examine extinction and persistence of reefal preference for reef-builders and reef-dwellers across the Phanerozoic. Reefal taxa exhibit lower extinction than nonreefal taxa, consistent with having more eurytopic environmental distribution. Reef-builders and reef-dwellers do not exhibit significant differences in extinction, but reef-builders express significantly higher rates of persistence in reefal habitats. Reef-builders and reef-dwellers do not exhibit consistent responses to episodes of reef crisis, perhaps due to variation in the drivers of each reef crisis. Nevertheless, reef-builders and -dwellers do not respond to perturbations in similar ways, and should be addressed separately when analyzing diversity dynamics of reefal taxa.