The transformation of the energy dependence of the cosmic ray proton flux in the keV to GeV region is investigated theoretically when penetrating inside molecular clouds (A(subscript v) > 5 mag). The computations suggest that energy losses of the cosmic ray particles by interaction with the matter of the molecular cloud are principally caused by the inelastic (electronic) interaction potential; the transformed energy distribution of energetic protons is determined mainly by the column density of the absorbing medium. A cutoff of the cosmic ray spectrum inside clouds by their magnetic fields is also phenomenologically taken into account. This procedure allows a determination of environment-dependent ionization rates of molecular clouds. The theoretically predicted ionization rates are in good agreement with those derived from astronomical observations of H(subscript 3) + absorption lines in the spectrum of the cloud connected with the Herbig Be star LkHα 101.