  We present a general method to compute the nonlinear matter power spectrum
for dark energy and modified gravity scenarios with percent-level accuracy. By
adopting the halo model and nonlinear perturbation theory, we predict the
reaction of a $\Lambda$CDM matter power spectrum to the physics of an extended
cosmological parameter space. By comparing our predictions to $N$-body
simulations we demonstrate that with no-free parameters we can recover the
nonlinear matter power spectrum for a wide range of different $w_0$-$w_a$ dark
energy models to better than 1% accuracy out to $k \approx 1 \, h \, {\rm
Mpc}^{-1}$. We obtain a similar performance for both DGP and $f(R)$ gravity,
with the nonlinear matter power spectrum predicted to better than 3% accuracy
over the same range of scales. When including direct measurements of the halo
mass function from the simulations, this accuracy improves to 1%. With a single
suite of standard $\Lambda$CDM $N$-body simulations, our methodology provides a
direct route to constrain a wide range of non-standard extensions to the
concordance cosmology in the high signal-to-noise nonlinear regime.
