The chemical reactions and pathways involving bile acids, any of a group of steroid carboxylic acids occurring in bile, where they are present as the sodium salts of their amides with glycine or taurine.