We develop a numerical model to predict the volume and distribution of gas hydrate in marine sediments. We consider the environment of a deep continental margin where sedimentation adds organic material to the region of hydrate stability. Conversion of the organic material to methane by bacteria promotes hydrate formation and depletes the supply of organic carbon. We derive mass balance equations for the volume of hydrate and gas bubbles in the sediments and account for the changing concentration of dissolved methane and salts in the pore fluid. The effects of sediment compaction and the associated fluid flow are explicitly modeled. Allowances for deeper sources of fluid are also described, though we focus on the case of an idealized passive margin where carbon is input solely through sedimentation. The numerical calculations indicate that the key parameters in this model are the rate of sedimentation, the quantity and quality of the organic material, and a rate constant that characterizes the vigor of biological productivity. Model predictions for conditions that are representative of the Blake Ridge are compared with observations from Ocean Drilling Program Leg 164. We obtain a very good match to the observed chlorinity profile, including the region below the stability zone, without invoking any extraneous sources of freshening. We also predict that hydrate is unlikely to occupy more than 7% of the pore volume, in good agreement with observed estimates.