For the first time in 29 years, the United States paid more money to foreign investors last summer than it gained from U.S. investments overseas, the government reported yesterday.

"The price of being a debtor country is starting to show up," said C. Fred Bergsten, director of the Institute for International Economics. He said an increasing gap in investment income has been masked by the large amount of income earned by old U.S. investments abroad and by interest earned by U.S. banks' overseas loans. "But now ... we have crossed the line and are starting to pay net interest," he said.

The $615 million third-quarter deficit in investment income marks a sharp turnabout from the previous three months, when the United States ran a $1.5 billion surplus in investment income, and from last year, when the surplus was $18.6 billion.

The deficit is expected to widen in coming years as America's interest bill for investments by foreigners keeps growing. Foreign ownership of U.S. businesses, real estate, stocks and bonds jumped by $68 billion in the third quarter, while American investment overseas increased by $29.2 billion.

The turnaround in investment income, contained in the Commerce Department report on the broadest measure of America's foreign transactions for the third quarter of 1987, is the latest manifestation of the United States' deteriorating position in the world economy.

The United States shifted in late 1985 from a major creditor nation, owed more by foreign interests than it owes overseas, to the world's largest debtor nation. Analysts said the U.S. debt to the rest of the world will be more than $400 billion by the end of the year and will likely approach $1 trillion by 1990.

The report showed that the U.S. current account deficit for the third quarter, which includes financial transactions as well as trade in goods and services, grew to a record $43.4 billion -- a jump from the $41.2 billion mark set in the April-May-June quarter.

The merchandise trade deficit for the quarter, adjusted for inflation, increased slightly to $39.8 billion from $39.6 billion. But the report showed a $5.2 billion increase in U.S. overseas sales, to $65.9 billion. Imports continued to flood into the country, as U.S. purchases overseas grew by $5.4 billion, to $105.1 billion.

The report showed that a net inflow of $68 billion in foreign assets into the country in the third quarter compared with $49.6 billion in the previous quarter. This shows that overseas investment in the country is continuing, outpacing U.S. investment overseas.