A broad rally Friday capped an otherwise poor week for stocks, especially those that depend on consumer spending.