US stock indexes closed their best week in two months with a flourish on Friday.