Verification of calculations of the depth-dose distributions in water, using GEANT4 (version of 4.9.3) and MCNPX (version of 2.7.0) Monte Carlo codes, was performed for the scatterer-phantom system used in the dosimetry measurements in the proton therapy of eye tumours. The simulated primary proton beam had the energy spectra distributed according to the Gauss distribution with the cut at energy greater than that related to the maximum of the spectrum. The energy spectra of the primary protons were chosen to get the possibly best agreement between the measured relative depth-dose distributions along the central-axis of the proton beam in a water phantom and that derived from the Monte Carlo calculations separately for the both tested codes. The local depth-dose differences between results from the calculations and the measurements were mostly less than 5% (the mean value of 2.1% and 3.6% for the MCNPX and GEANT4 calculations). In the case of the MCNPX calculations, the best fit to the experimental data was obtained for the spectrum with maximum at 60.8 MeV (more probable energy), FWHM of the spectrum of 0.4 MeV and the energy cut at 60.85 MeV whereas in the GEANT4 calculations more probable energy was 60.5 MeV, FWHM of 0.5 MeV, the energy cut at 60.7 MeV. Thus, one can say that the results obtained by means of the both considered Monte Carlo codes are similar but they are not the same. Therefore the agreement between the calculations and the measurements has to be verified before each application of the MCNPX and GEANT4 codes for the determination of the depth-dose curves for the therapeutic protons.