WASHINGTON — Better. The job market beat expectations, and the stock market managed a modest gain — not great, but good enough after a turbulent week.The nation added 117,000 jobs in July, the government said Friday — far from what happens in a healthy economy, and only good for a reduction of one notch in the unemployment rate, to 9.1 percent.But the jobs number beat the forecast of economists, who were expecting no more than 90,000. And it was an overwhelming relief for investors, who just lived through two of the most brutal weeks in Wall Street history.“Nothing to pop Champagne corks over,” said Diane Swonk, chief economist at Mesirow Financial, “but a much-needed shot in the arm for confidence at a time when we have so little.”But when they come back on Monday, investors will have to absorb another body blow: Late Friday, ratings agency Standard & Poor’s downgraded the United States’ debt for the first time, saying the government’s debt-reduction plans fall short. The downgrade could lead to higher interest rates and further hamper the economic recovery.The Dow Jones industrial average finished Friday with a gain of 60.93 points and closed at 11,444.61. It made up only a small fraction of the losses from Thursday, when the Dow dropped 512, its worst since the financial crisis of 2008.