  Cosmic rays are a fundamental source of ionization for molecular and diffuse
clouds, influencing their chemical, thermal, and dynamical evolution. The
amount of cosmic rays inside a cloud also determines the $\gamma$-ray flux
produced by hadronic collisions between cosmic rays and cloud material. We
study the spectrum of cosmic rays inside and outside of a diffuse cloud, by
solving the stationary transport equation for cosmic rays including diffusion,
advection and energy losses due to ionization of neutral hydrogen atoms. We
found that the cosmic ray spectrum inside a diffuse cloud differs from the one
in the interstellar medium for energies smaller than $E_{br}\approx 100$ MeV,
irrespective of the model details. Below $E_{br}$, the spectrum is harder
(softer) than that in the interstellar medium if the latter is a power law
$\propto p^{-s}$ with $s$ larger (smaller) than $\sim 0.42$.
