(Reuters) - U.S. stocks gained on Friday in another volatile session during a week of huge swings that shook the market out of months of calm.