An acceleration in the U.S. economy in recent months should relieve fears about the economic expansion losing steam, but the third-quarter improvement does little to change the trajectory of a long but weak path for growth.

Gross domestic product, the broadest measure of U.S. output, advanced at a 2.9% inflation-adjusted annual rate in the third quarter, the Commerce Department said Friday. It was the strongest quarterly reading in two years after three straight quarters of sub-2% growth.

But...