Unlike gas-phase reactions, chemical reactions taking place on interstellar dust grain surfaces cannot always be modeled by rate equations. Due to the small grain sizes and low flux,these reactions may exhibit large fluctuations and thus require stochastic methods such as the moment equations. We evaluate the formation rates of H2, HD and D2 molecules on dust grain surfaces and their abundances in the gas phase under interstellar conditions. We incorporate the moment equations into the Meudon PDR code and compare the results with those obtained from the rate equations. We find that within the experimental constraints on the energy barriers for diffusion and desorption and for the density of adsorption sites on the grain surface, H2, HD and D2 molecules can be formed efficiently on dust grains. Under a broad range of conditions, the moment equation results coincide with those obtained from the rate equations. However, in a range of relatively high grain temperatures, there are significant deviations. In this range, the rate equations fail while the moment equations provide accurate results. The incorporation of the moment equations into the PDR code can be extended to other reactions taking place on grain surfaces.