Companies from Mondelēz to McDonald's are raising prices to offset higher costs for transportation and because of labor and other problems along the supply chain.