Properties of the Interstellar Medium and the Propagation of Cosmic Rays in the Galaxy