The stock market headed to one of its best days of the year Friday, shaking off a historic stretch of losses, as investors responded positively to the latest inflation update.