U.S. equities finished higher, with all the major indexes posting solid gains for the week.