While many geological and geophysical processes such as the melting of icecaps, the magnetic expression of bodies emplaced in the Earth's crust, or the surface displacement remaining after large earthquakes are spatially localized, many of these naturally admit spectral representations, or they may need to be extracted from data collected globally, e.g. by satellites that circumnavigate the Earth. Wavelets are often used to study such nonstationary processes. On the sphere, however, many of the known constructions are somewhat limited. And in particular, the notion of 'dilation' is hard to reconcile with the concept of a geological region with fixed boundaries being responsible for generating the signals to be analyzed. Here, we build on our previous work on localized spherical analysis using an approach that is firmly rooted in spherical harmonics. We construct, by quadratic optimization, a set of bandlimited functions that have the majority of their energy concentrated in an arbitrary subdomain of the unit sphere. The 'spherical Slepian basis' that results provides a convenient way for the analysis and representation of geophysical signals, as we show by example. We highlight the connections to sparsity by showing that many geophysical processes are sparse in the Slepian basis.