For a classic demonstration of how a bear market works, the stocks of companies in the chemical industry seem to possess all the necessary elements.

Their prices have been battered across the board in recent months as the stock market as a whole has fallen to its lowest levels in a year and a half.The selling has been relentless, even for stocks of companies that appeared to be well-positioned in specialized markets presumed to be resistant to recessions and the effects of soaring oil prices.

"We realize that a bear market is tough on everyone," says Paul Leming, chemical industry analyst at Wall Street's Morgan Stanley & Co. "The level of pain and suffering in the chemical industry has gone beyond the bounds of good taste, however."

Through August and September, Leming said, the chemical stocks he follows tumbled an average of 25 percent, while the Standard & Poor's 500-stock composite index dropped 14 percent.

"The market seems to be making no distinction between the fundamentals of different companies," he said. "The stocks are just being taken out and shot."

There are a couple of broad reasons why the chemical stocks' reaction to recent events has been so pronounced, observers say.

First of all, the business has a firmly entrenched image as a smokestack industry whose fortunes have long been sensitive to the ups and downs of the economic cycle. Whisper "recession" and the chemical stocks feel a breeze.

Secondly, the industry is a heavy user of petroleum-based raw materials, putting it squarely in the path of the oil-price increases that have followed Iraq's invasion of Kuwait.

"The sharp escalation in oil prices is having a major impact on the fundamentals of the basic chemical industry," says George Krug, who follows the stocks for Oppenheimer & Co.

A good many analysts argue, however, that the same conclusion isn't warranted, or at least not to the same degree, for companies in specialty chemicals - for example, coatings, adhesives, dyes and cleaning materials.

"In many respects, specialty chemical companies are a world apart from their basic chemical counterparts," Stephen Grant, an analyst at Value Line Investment Survey, says in the advisory firm's latest quarterly report on the industry.

Basic chemical manufacturers most likely will have to absorb the brunt of the increase in petrochemical costs, passing only part of the increase through to the specialty companies, Grant argues.

Therefore, he says, "raw materials costs for specialty chemical producers probably will continue to advance only modestly."

As for the chemical industry as a whole, most analysts believe a full-fledged revival may have to await signs pointing to the next upward turn in the economic cycle.

Said Leming at Morgan Stanley: "Today's problems - the predominant one being overcapacity - are likely to sow the seeds for tomorrow's boom. As profitability deteriorates, there should be a slowdown in capacity additions.

"We don't believe it's appropriate to give up on the chemicals forever, because we think this group will once again have its day in the sun. Unfortunately, that day could be as far away as 1995."