Residual fuel oil, that bottom-of-the barrel product that remains after crude oil is refined into gasoline, jet fuel, heating oil and diesel fuel, is staging a comeback.

Although U.S. demand for "resid," or No. 6 fuel oil, has been declining for the last 16 years to just over 1 million barrels a day in 1992 from 3 million in 1977, higher prices for competing natural gas drove dual-fuel users to switch to oil this summer.What's more, resid's year-on-year decline is expected to reverse in 1994 and actually increase by 7 percent, according to government estimates, largely

because gas prices are projected to rise faster than oil.

In August, the demand for resid grew for the second consecutive month, climbing to an average of 961,000 barrels a day, up by 2.1 percent from August 1992 and slowing the annual rate of decline to 7.6 percent, American Petroleum Institute figures show.

The reason? Temperatures in New England and the Mid-Atlantic states, where fuel oil use is greatest, were about 70 percent warmer than last August. That drove spot natural gas prices up to an average $2.32 for a million British thermal units, from $2.10 in July and $1.90 in August 1992, just as users were begining to store gas for the coming winter.

Since then, both the weather and gas prices have moderated. But competition between the two fuels will reoccur if gas prices rise this winter, with fuel- switching likely when spot gas at the wellhead rises above the magic trigger of $2.32 for a million Btu, according to a research report by Salomon Brothers gas analyst Tom Driscoll.

According to his analysis, low-sulfur, utility-grade fuel oil prices have returned to historical levels, averaging about 85 percent of West Texas Intermediate crude, and fuel switching is likely to occur when wellhead gas prices exceed $2.32 for a million Btu.

These days, burning of resid accounts for less than 4 percent of total U.S. power production. But very cold winter weather could drive prices for both fuels sharply higher, he said, creating some intense price competition.

"The two fuels could chase each other up," Mr. Driscoll said in a telephone interview. "They've done it in years past. But historically, how many months have resid prices been above 110 percent (of crude)? Not very many, but this year could be different, because of the tightness of gas."

What's the outlook for resid?

''It has to do with crude composition, economic activity, and the source of the fuel oil," said Guillermo Guariguata, president of Bonner & Moore Marketing Consultants, Houston.

Mr. Guariguata said that increasing economic activity will boost demand for resid, but that low crude prices this year have meant that refiners can afford to run more high-quality crudes, which means less resid will remain after the high-value products are removed.

"You are seeing crude oil prices that are very low, and that the differentials between high and low-quality crude oils has narrowed," he said. ''Better quality crudes mean less fuel oil production."

As a result, prices for high-sulfur fuel oil have increased in recent months, to about $10 a barrel from $9 a barrel in June. "Fuel oil will likely remain in the $10-to-$11-a-barrel range for most of this winter," he said.

Longer term, continuing refinery upgrades will mean that lower-quality crudes can also be refined without leaving large amounts of resid behind, again reducing supply.

"The refiners will be able to better control their resid output. They will have more flexibility, so there should be expectations that resid prices will rise," Mr. Guariguata said.

In August, low-sulfur resid averaged $14.38 a barrel on the U.S. Gulf Coast, compared to $10.10 for the high-sulfur product, Bonner & Moore figures show. By the end of this year, low-sulfur resid is expected to peak at $16.30 a barrel, with the high-sulfur product reaching $11, the company estimates.

These days, U.S. demand for resid averages about 1 million barrels a day, he said, with peaks of up to 1.4 million barrels. U.S. refining capacity can handle average domestic demand, but the peaks must come from imports. But offshore refineries in the Caribbean and Venezuela, a traditional source of U.S. resid imports, are also upgrading their ability to produce more value- added products, further tightening supply.

The refining consultants said that Gulf Coast prices for low-sulfur fuel oil will average $11.10 in 1994 and $11.40 in 1995, while the low-sulfur product will average $15.60 and $15.90 a barrel, respectively.

As a percentage of crude oil values, resid will average 90 percent of West Texas Intermediate prices, down from 97 percent in 1987 but higher than the 76 percent posted in 1991, when the Persian Gulf War forced refiners to use more low-quality crudes, flooding the market with resid.