Former deputy defense secretary Paul Thayer is one of few who have been sentenced to prison in a case involving inside stock-trading, an increasingly widespread phenomenon that is the focus of a growing number of federal investigations.

The Securities and Exchange Commission settles most such cases through civil consent decrees in which defendants neither admit nor deny guilt but agree to repay ill-gotten profits.

In recent years, however, the SEC has referred many more cases for criminal prosecution, which often includes charges of obstruction of justice such as that for which Thayer and an associate received a four-year sentence yesterday.

Officials said the surge of corporate mergers and takeovers, which generally drive up the stock price of a company targeted for acquisition, has given insiders more opportunities to make a quick killing on the stock market.

"There's a tremendous financial temptation to trade on an upcoming tender offer," said Curt H. Mueller, an SEC enforcement division official. "It skewers the market. People aren't going to invest their money if they think they're going to get ripped off by the big boys with inside knowledge."

SEC enforcement division director Gary Lynch said the Thayer sentence "is a strong, unambiguous message to those who abuse insider information or the investigative process." SEC officials said they could not recall a stiffer sentence.

Business Week magazine recently called insider trading "an epidemic." In a study of takeovers and mergers involving publicly traded companies in the last two years, it found that stock prices rose in the month before an announcement 72 percent of the time. General market trends would account for 52 percent of the rise, it said.

In sentencing Thayer, U.S. District Court Judge Charles R. Richey said, "If you ride up and down the elevators in the office buildings of Wall Street, you can hear all kinds of rumors and gossip about possbile takeovers, mergers . . . from people who have no business discussing in such places inside information. Many people take advantage of that."

Gordon S. Macklin, president of the National Association of Securities Dealers, said Thayer's sentence "was not too harsh." He said that insider trading is not an epidemic but that "it's happening every week."

Washington securities lawyer Robert B. Robbins said the sentence "will be a deterrent." He added that "there are probably more cases than the SEC, with their limited staff, could prosecute."

A 1984 law enables the SEC to recover triple damages in insider trading cases. "The stakes are getting higher," said Anne Flannery, SEC enforcement division chief in New York. "The risk of getting caught and being prosecuted is much greater than it was."

The Pacific Stock Exchange has asked the SEC to join an investigation into trading call options on ABC network stock before the successful takeover bid by Capital Cities Communications on March 18. The volume of trading increased dramatically in the days before the bid was announced.

Thomas C. Reed, a secretary of the Air Force under President Gerald R. Ford and National Security Council staff assistant under President Reagan, is awaiting trial on criminal charges that he used an insider tip about a takeover attempt from his father, a director of Amax Corp., to turn a $3,000 investment in Amax into a $427,000 profit in 1981. A Wall Street Journal reporter is on trial for leaking information from the newspaper's stock column.

Officials said unraveling such cases is often complicated because the information may be passed along by a messenger, word processor or other low-level employe, or a corporate official may provide a tip to a distant relative.