Chemical Fractionation in Gas Rings and the Formation of the Solar System