U.S. stocks ended a wild week on a higher note with all three major averages rallying into the close Friday.