Stock prices for a wide range of U.S. pharmaceutical companies rose sharply yesterday in anticipation of a possible wave of takeover offers from overseas drug companies.

The heavy buying followed Monday's announcement of a $4.2 billion hostile takeover offer by Swiss pharmaceutical giant F. Hoffman-La Roche and Co. AG for Sterling Drug Inc., the New Jersey-based maker of Bayer aspirin, Midol pain reliever and Lysol cleaner, as well as last week's acceptance by Richmond-based A.H. Robins Co. of a takeover offer from Sanofi S.A., a French drug maker.

The Robins offer -- which includes a $2.475 billion fund for victims of the defective Dalkon Shield intrauterine contraceptive device -- is subject to approval by a federal bankruptcy judge.

Some analysts predicted the same factors that helped fuel those two offers -- the weakened U.S. stock market, the faltering American dollar and desires by European drug companies to increase their marketing presence in the United States -- could invite more takeover attempts from foreign companies in the next few months.

"The time is ripe," said Neil Sweig, an analyst at Prudential-Bache in New York. "Every major foreign company looks lovingly at this market. Nineteen-eighty-eight may be the year they can finally afford what they've longed to buy for years."

According to research done by S.G. Warburg & Co. Inc. in New York, for example, the declining dollar meant that between the end of 1984 and the beginning of December of 1987 the value of many American drug companies as expressed in German marks fell substantially.

The value of Smithkline Beckman Corp., for example, dropped 32 percent during that time, Warner-Lambert Co. fell 10 percent, and Bristol-Myers Co. dropped 20 percent.

Yesterday's market gains for many drug stocks averaged 5 percent or more, with the strongest performance posted by small- to medium-sized firms most likely to be the subject of takeover interest. Among the biggest gainers were Rorer Group Inc., up $7.25 to $44.75; Schering-Plough Corp., up $3.12 to $52.37; and Warner-Lambert, up $3.25 to $73.25.

But even with those gains, some analysts said American drug companies remain a bargain to many European firms that might be willing to pay considerably more than current market prices for American targets.

The offer by Hoffman-La Roche for Sterling Drug, for example, was $72 a share, almost 30 percent higher than the company's closing price Monday of $56.87.

Sterling stock jumped $17.25 yesterday to $74.12, indicating investors thought Hoffman-La Roche would be willing to buy Sterling at an even higher price.

"We peg the final purchase price in the mid-80s," said Samuel D. Isaly, head of pharmaceutical research for S.G. Warburg, who estimated that Hoffman-La Roche could pay as much as $90 a share for Sterling without diluting its earnings.

The attraction for foreign drug companies isn't restricted to price.

Sterling offers Hoffman-La Roche a strong position in consumer products, a newly approved heart-disease drug and a strong American marketing staff -- all things the Swiss firm currently lacks.

For other analysts, however, Hoffman-La Roche's enthusiasm for Sterling is not necessarily the beginning of a trend.

"It's possible that acquisition activity is stimulating the market, but remember, it's only two companies. This isn't an industry that's too prone to takeovers," said Juan Noble, an analyst with Argus Research in New York.

Drug stocks also were up yesterday on the London stock exchange, and Noble said the chief cause of that increase was heavy buying by institutional investors worldwide who were returning to the drug industry.

"Typically, these are regarded as defensive stocks, things that are good to have in uncertain times," Noble said.

---------------------------------------------------------------------

--------------DRUG-INDUSTRY TAKEOVER PLAYERS-------------------------

--------------------------------------------------------------------- COMPANY-------------------SALES--------------EARNINGS---------EARNINGS -------------------------------------------------------------PER SHARE ---------------------------------------------------------------------- American Cyanamid Co.......1986 $3.8 billion.....$202.5 million..$4.36 .........................9 mos. $3.1 billion.....$215.4 million...2.35 American Home Products.....1986 $4.9 billion.......$779 million...5.18 .........................9 mos. $3.8 billion.......$630 million...4.26 Bristol-Myers..............1986 $4.8 billion.....$589.5 million...4.13 .........................9 mos. $4.0 billion ....$535.6 million...1.87 Pfizer.....................1986 $4.5 billion.......$660 million...3.90 .........................9 mos. $3.6 billion.....$553.6 million...3.26 A.H. Robins..............1986 $789.9 million......$81.8 million...3.38 .........................9 mos. $621 million......$60.3 million...2.50 Rorer Group................1986 $845 million.....$125.6 million...5.78 .........................9 mos. $647 million......$31.9 million...1.46 Schering-Plough Corp.......1986 $2.4 billion.....$265.8 million...4.34 .........................9 mos. $2.0 billion.....$241.2 million...2.06 SmithKline Beckman Corp....1986 $3.7 billion.....$521.1 million...6.78 .........................9 mos. $3.1 billion.....$428.1 million...3.36 Squibb.....................1986 $1.8 billion.....$396.3 million...7.37 .........................9 mos. $1.6 billion.....$273.8 million...2.61 Sterling Drug Inc.........1986 $1.99 billion.....$171.5 million...2.91 .........................9 mos. $1.7 billion.....$145.1 million...2.51 Syntex Corp................1987 $1.1 billion.....$248.8 million...2.07 .........................3 mos. $306 million......$75.4 million.....64 Warner-Lambert.............1986 $3.1 billion.....$309.5 million...4.18 .........................9 mos. $2.6 billion.....$229.6 million...3.20 ---------------------------------------------------------------------- -------------------------------------------------- COMPANY -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- PRICE 1/5--------CHANGE -------------------------------------------------- American Cyanamid Co........ 46.................+3 American Home Products.......76................+1 1/2 Bristol-Myers................43 5/8................+ 3/8 Pfizer.......................52 5/8............... +4 A.H. Robins..................21 1/2...............+1 1/4 Rorer Group..................44 3/4...............+7 1/4 Schering-Plough Corp.........52 3/8...............+3 1/8 SmithKline Beckman Corp......54 1/4................+4 Squibb.......................66 1/2...............+2 5/8 Sterling Drug Inc............74 1/8..............+17 1/4 Syntex Corp..................34 3/8...............+1 1/2 Warner-Lambert...............73 1/4...............+3 1/4

Source: Stock data: Johnston Lemon; Company data from the companies