We study the effect of the stochastic time variations of the environment on the reaction rate constant of an elementary chemical reaction. The reaction is modelled by a one-dimensional stochastic process, which can belong to a very broad class. The short-range fluctuating interactions between the reacting complex and the solvent molecules are simulated by dichotomous barriers obeying a Poisson process, which can hinder the process. Then we relate the overall reaction constant to the reaction constant of the pure reactive process, in the absence of the barriers. We give exact results in the case of one and two barriers, and a complete analysis of the overall reaction constant, or equivalently of the overall transmission probability of the system, is presented. In particular we show that, under certain conditions, a stochastic resonance occurs, in the sense that the transmission probability can be maximized by a convenient choice of the parameters of the barriers. In this case, the fluctuating barriers increase this transmission probability with respect to its value for the purely reactive process.