  Cosmic-ray (CR) electrons and nuclei interact with the Galactic interstellar
gas and produce high-energy $\gamma$ rays. The $\gamma$-ray emission rate per
hydrogen atom, called emissivity, provides a unique indirect probe of the CR
flux. We present the measurement and the interpretation of the emissivity in
the solar neighborhood for $\gamma$-ray energy from 50~MeV to 50~GeV. We
analyzed a subset of 4 years of observations from the Large Area Telescope
(LAT) aboard the {\it Fermi Gamma-ray Space Telescope} ({\it Fermi}) restricted
to absolute latitudes $10^o<|b| <70^o$. From a fit to the LAT data including
atomic, molecular and ionized hydrogen column density templates as well as a
dust optical depth map we derived the emissivities, the molecular hydrogen to
CO conversion factor $X_{CO}=(0.902\pm0.007) \times 10^{20}$ cm$^{-2}$ (K km
s$^{-1}$)$^{-1}$ and the dust-to-gas ratio $X_{DUST}=(41.4\pm0.3) \times
10^{20}$ cm$^{-2}$ mag$^{-1}$. Moreover we detected for the first time
$\gamma$-ray emission from ionized hydrogen. We compared the extracted
emissivities to those calculated from $\gamma$-ray production cross-sections
and to CR spectra measured in the heliosphere. We observed that the
experimental emissivities are reproduced only if the solar modulation is
accounted for. This provides a direct detection of solar modulation observed
previously through the anticorrelation between CR fluxes and solar activity.
Finally we fitted a parametrized spectral form to the heliospheric CR
observations as well as to the {\it Fermi}-LAT emissivity and obtained
compatible local interstellar spectra for proton and Helium kinetic energy per
nucleon between between 1 and 100~GeV and for electron-positrons between 0.1
and 100~GeV.
