In organic-rich sediments laid down in fresh water, much less diagenetic pyrite is formed than in analogous marine sediments because of the much lower concentrations of dissolved sulfate found in most fresh waters as compared to seawater. As a result, modern organic-rich freshwater sediments exhibit a much higher organic carbon-to-pyrite sulfur ratio (C/S) than marine sediments with similar organic contents. On this basis, C/S ratios can be used to distinguish ancient marine from freshwater (or slightly brackish) sedimentary rocks. This is demonstrated here for several Carboniferous shales and siltstones. The C/S technique cannot distinguish brackish-water sediments deposited under salinities greater than half that of seawater from marine sediments, as demonstrated by analyses of modern Chesapeake Bay sediments. Also, the method is not applicable to nearly pure limestones or to rocks low in organic matter (less than about 1% organic carbon). Saline (high sulfate) phases of ancient lakes can be distinguished from nonsaline phases using the C/S method.