U.S. stocks finished higher Friday, with the S&P 500 scoring a back-to-back record finish, despite data on Thursday showing inflation running hot.