Stellar activity produces subtle time-dependent changes in a star's face-averaged spectrum that can mask or mimic a Doppler shift corresponding to exoplanet-induced reflex motion. These corrupting influences limit our ability to detect small exoplanets via Doppler spectroscopy (the RV method). Typical pipelines derive a Doppler shift estimate from the spectrum at each observed epoch, producing a radial velocity time series. To account for stellar activity in an exoplanet search, an extra component is included in the RV time series model (e.g., apodized oscillations, or a stochastic process), possibly using supplementary activity indicators derived from the spectra as covariate time series (e.g., measures of line asymmetry). We describe a framework that directly models the evolving spectrum as a function of wavelength and time, simultaneously estimating Doppler shifts and data-derived spectroscopic signatures of stochastic stellar variability. The approach uses a separable expansion, writing the dynamic spectrum as a sum of products of separate spectral and temporal basis functions. The data's high spectral resolution enables estimating the spectral basis functions via a modified form of principal components analysis (PCA). The limited, irregular temporal sampling motivates using coupled Gaussian processes (GPs) to learn temporal basis functions from the data. Our framework compares hundreds of choices for the coupled GPs via a two-stage process, using information criteria or cross-validation to quickly identify a promising subset of models, whose statistical power is then carefully computed via extensive simulations, identifying the most powerful model. Using Sun-as-a-star simulated data, we show that our approach can significantly improve planet detection capability when stellar activity is due to star spots: our best models have velocity semi-amplitude detection thresholds half that of competing approaches. Simulation studies indicate that basis functions learned when large spots are present are effective for modeling the activity due to small spots, suggesting that it could be useful to observe some stars even during periods of high activity (when small planets are undetectable).