Molecular clouds are imperative to astronomy as the sites of all known star formation. The problem of how molecular clouds are formed in spiral galaxies is approached numerically, by modelling the response of a gas disk to a spiral potential. The importance of spiral shocks is highlighted as a dominant formation mechanism for molecular clouds in grand design galaxies, where a strong density wave is present. The spiral shock both increases the density of the interstellar gas significantly, and produces structure in the spiral arms. The gas evolves into discrete clumps, which are shown to contain substantial densities of molecular hydrogen, and are therefore identified as molecular clouds. The formation of these clouds requires that the interstellar medium (ISM) is cold and inhomogeneous. The passage of an inhomogeneous gas distribution through a spiral potential further shows that supersonic velocities are induced as the gas shocks. This can explain the velocity dispersion relation observed in molecular clouds. Finally, the shearing of clumps of gas in the spiral arms leads to the formation of inter-arm structures, which are commonly observed in spiral galaxies.