A quantum Monte Carlo approach is applied to the treatment of the pairing force in nuclear systems. The method makes possible the calculation of the pairing energy and the pair occupation probabilities for the ground state. It is computationally efficient, and also very simple to implement. The reliability of the method is checked with the use of two exactly solvable schematic shell models. The computed pairing energy is also compared with the predictions of several approximation methods of common use. Numerical results for some nuclei with a realistic interaction are also provided. (author) 44 refs.; 4 figs.; 2 tabs.