Despite the travails that beset the nation's giant banks -- from faltering companies and defaulting countries to costly scandals like the failures of Penn Square Bank and Drysdale Government Securities -- most major institutions should report strong profits in the three-month period that ends Sept. 30.

The banks are not out of the woods. The problems that plague many of them are real and will not go away in the forseeable future. Problem loans will rise at even the strongest banks and more banks will fail in the weeks and months ahead, especially institutions that make many of their loans to the energy and agricultural industries.

But in the third quarter all the problems that eat away at profits in the major, so-called money center banks, and their large-sized regional cousins, will be overshadowed by the enormous profits those banks are making on most of their business and consumer loans.

The interest the big banks are paying to attract deposits has declined much more rapidly than the interest the banks charge their customers for loans. The difference -- the interest "spread" between the cost of deposits and the return from loans -- is the major source of revenues and profits at most banks.

During periods of rising interest rates, banks find it difficult to raise their loan charges fast enough to keep pace with the increasing costs of their deposits. During periods of falling rates, according to Salomon Brothers Inc. analyst Thomas Hanley, it is normal for bank charges such as the prime lending rate to "lag" declines in deposit costs.

Banks, in other words, try to recoup losses during periods of falling rates by allowing the interest spread to get bigger.

According to figures compiled by Salomon Brothers, the spread between the prime lending rate and the cost of some types of bank deposits has more than doubled in recent months.

That is not to say that bank profits will double. Nor is it to say that interest revenues will double. Battered by years of high interest rates and anxious to get longer term, in addition to shorter term deposits, banks could not turn over all their big deposits to take advantage of declining rates. A $1 million, six-month deposit a bank paid 14 percent to obtain in mid-June will cost the bank 14 percent until mid-December.

The big money center banks -- those with households names such as Citibank, Chase Manhattan, Morgan Guaranty, Continental Illinois, Manufacturers Hanover and First Chicago -- do not obtain most of their deposits in the traditional way. To these banks, and many other banks whose names are not quite so well known, checking accounts and savings accounts represent a tiny fraction of the funds they use to make loans.

Instead, these banks "buy" most of their deposits from corporations or other banks with cash to invest for periods as short as overnight or as long as a year. Twenty years ago a bank's ability to make loans was governed to a large degree by the size of its checking and savings accounts. Today, for the bigger banks at least, the size of their deposits is governed by the loans they make.

If, for example, Citibank's loans increase by $10 million today, Citibank will enter the amorphous network of lenders and borrowers called the money market and buy, at the going rate, $10 million in new deposits.

Citibank might issue giant "certificates of deposit" -- through which an investor puts funds into the bank for a period that can range from days to months -- or it might buy "federal funds" from other banks that have spare cash for a 24-hour period. In the complicated, fast-paced world of multinational banking, it is not uncommon for a bank like Citibank to be both a buyer and a seller of federal funds on the same day.

For reasons that no one can quite explain, rates in the money markets have plunged. On June 24, for example, a 90-day certificate of deposit cost the issuing bank more than 15 percent, while during most of August and September those same deposits cost less than 11 percent, according to William Sullivan, vice president of the Bank of New York.

According to Salomon Brothers, the spread between the rate on 90-day certificates and the prime lending rate grew from about 2.15 percentage points during the second quarter to 3.85 percentage points early this month. The spread was more marked for "overnight" money. During the second quarter, on average, the prime rate was about 1.8 percentage points bigger than the federal funds rate. Early this month, the spread was 4.76 percentage points.

On balance, for the big banks that "buy" most of their deposits in the money market, the net interest spread should widen from about 2.5 percentage points to 3 percentage points, according to Lawrence Fuller, banking analyst for the brokerage firm Drexel Burnham Lambert. On $1 billion in loans, that difference is more than $1 million for a three-month period.

The spread at any individual bank depends on how "short-term" its purchased deposits were. The bigger the proportion of deposits that matured and were replaced in July, August and September, the more a bank's profits should benefit.

Banks such as Wells Fargo, which have a large number of consumer depositors who bought high-yielding six-month certificates of deposit for $10,000 last spring, will benefit from declining rates less quickly than a bank like Chicago's Continental Illinois, which relies almost totally on purchased funds whose maturities are short, Fuller said.

Continental, apparently the biggest loser in the failure of Penn Square National Bank, has been forced by investors to pay more to attract deposits than most other money center banks. Even so, a 1 percentage point premium on funds that cost most banks 10.5 percent today is healthier for Continental's income statement than the 15 percent it had to pay in June before its image was tarnished by the disaster at Penn Square.

Banks, however, are not likely to take all their new-found revenues as profits.

Because many bank borrowers are unhealthy financially, banks likely will deduct large, perhaps record, amounts from their profits to add to their reserves against loans that go bad. That will chip away at the profits from the good loans.

In addition, companies have been reducing their bank loans in recent months, issuing bonds to transform some of their short-term bank debt to more stable, long-term loans.

In July and August, business loans outstanding fell about $2 billion -- a normal development in the history of business cycles. As a result, banks have fewer loans off which they can make bigger profits. But $2 billion is a drop in the loan bucket of the nation's banking system.

On balance, according to analysts, the bigger profit margins banks are earning on their remaining good loans are so great that third quarter profits will be strong, if not astounding, considering the weak state of the economy and many of the banks' customers.

By the fourth quarter, however, the prime rate will move more into equilibrium with money market rates -- the fall in rates appears to be over -- and the interest spreads again will narrow.

Even if the economy starts to improve, here and abroad, companies and countries will take a long time to recover. Normally bad loans continue to grow for several months after an economic recovery starts.

Big bank profits in the third quarter likely will be seen, in retrospect, as a heady blip in a difficult scenario.