A Theory for the Thermally Activated Rate Constant in Systems with Spatially Dependent Friction