The endolithic environment, the pore space in rocks, is a ubiquitous microbial habitat and an interface between biology and geology. Photosynthesis-based endolithic communities inhabit the outer centimeters of rocks exposed to the surface, and offer model systems for microbial ecology, geobiology, and astrobiology. Endolithic ecosystems are among the simplest microbial ecosystems known and as such provide tractable models for testing ecological hypotheses. Such hypotheses have been difficult to test because microbial ecosystems are extraordinarily diverse. We review here recent culture-independent, ribosomal RNA-based studies that evaluate hypotheses about endolithic ecosystems, and provide insight for understanding general principles in microbial ecology. Comparison of endolithic communities supports the principle that patterns of microbial diversity are governed by similar principles observed in macroecological systems. Recent results also explore geobiological processes that shape the current biosphere and potentially provide clues to life's history on Earth and where to seek life elsewhere in the Solar System.