Carbon dioxide reacts with water to produce carbonic acid, which is a weak acid that contributes to the overall acidity of rainwater. Carbon dioxide also dissolves in soil, where it can react with minerals to produce acids that contribute to soil acidity.