Rayleigh–Ritz calculation of the activation rate in the spatial diffusion regime