Prices rose 4.2% in May compared to a year earlier, marking an increase from a year-over-year inflation rate of 3.8% in the prior month.