Purpose: Critical analysis of existing and obtaining more accurate data on the spatial dose distributions created in the water phantom by pencil beams (PB) of monoenergetic and bremsstrahlung photons with energies from 0.25 to 20.0 MeV, and approximation of these distributions for the purpose of calculating doses in radiation therapy. Material and Methods: Using the Monte Carlo method, the EGSnrc program and the MATLAB mathematical package, these distributions were calculated for monoenergetic photons in the energy range from 0.25 to 19.75 MeV in increments of 0.5 MeV, for bremsstrahlung photons with a maximum energy of 4.0, 6.0, 10.0, 15.0, 18.0 MeV and for the gamma-radiation spectrum of the therapeutic apparatus ROCUS. The calculation results are converted into the so-called dose kernel of photon pencil beam. The obtained dose kernel values are compared with previously published data and the observed discrepancies are discussed. Depths in water were studied from 1.0 to 40 cm in increments of 0,5 cm and along the radius from 0.02 to 46.0 cm with an uneven grid. For bremsstrahlung and photons with the spectrum of the Rocus apparatus, the possibility of approximating dose kernel values using approximation formulas convenient for calculating doses in radiation therapy has been investigated. Results: On the basis of the results obtained, a new version of the library of dose kernels of a pencil photon beam for water was created, which differs from previous versions by the use for calculating a better description and modeling of the physical processes of the interaction of photons and charged particles with matter, more adequate data on the interaction cross sections and significantly lower values of statistical uncertainties of the results. For bremsstrahlung and photons with the spectrum of the Rocus apparatus, a mathematical model of dose kernels of a pencil beam is proposed, which includes decomposition of the dose kernels into components of the primary and scattered doses, approximation formulas and empirical coefficients convenient for integration. The values of empirical coefficients are determined by fitting to the results of the calculation of dose kernels using a combination of the random search method and the nonlinear regression method. Conclusion: The results obtained in this work will improve the algorithms and increase the accuracy of dose calculation when planning remote therapy with photon beams.