When the markets collapsed two weeks ago, Hechinger Co.'s stock same under the cloud that hung over the markets in general. But executives at the do-it-yourself home improvement company found a silver lining -- a chance to buy back stock relatively cheaply to fund a stock option program for the company's managers. Hechinger's board of directors had authorized the stock repurchase program at least a year before but, until the market's spectacular slide, had bought only a small number of shares, said Clark McClelland, senior vice president for finance.

"When the market went in the tank, unfortunately, we went with it and the price of our stock was very low," McClelland said. From a high this year of $26, the company's Class A common stock, its most widely traded stock, fell to 15 1/4.

"We were going to have to buy it at some point, and right now it looks like a good use of corporate assets," he said.

The company announced on Monday that it would buy back 250,000 shares of Class A and 100,000 of the more narrowly traded Class B, stock owned principally by Hechinger family members.

In the two weeks that followed the stock market's spectacular plunge on Oct. 19, hundreds of companies announced plans to buy back their damaged stock, focusing attention on what is normally an unremarkable corporate phenomenon.

One reason for the buybacks was corporate cheerleading, designed to hearten investors who suddenly felt like losers.

In a nervous market, it reassured investors to know "that management stepped up to the plate to say they think the stock is undervalued," one corporate researcher said.

In some cases, it was difficult to determine the motivation behind the buybacks. In good times and in bad, corporations generally announce stock repurchase programs with a minimum of elaboration.

Dayton Hudson Corp., for instance, said only that its board of directors "authorized purchases by the corporation of up to 15 million shares of its common stock from time to time in transactions on the New York Stock Exchange or otherwise" without mentioning a purpose.

But in that case, at least one reason was clear. The retailer had been battling a takeover bid by Washington's Haft family until the market's nose dive forced the Hafts to drop their pursuit. The acquisition by the company of additional shares of its stock could provide protection against future takeover attempts.

Atlantic Research Corp., an Alexandria defense contractor, was also the recent target of a takeover attempt. Earlier this month, however, Clabir Corp. of Connecticut said it was abandoning its attempt at a hostile takeover of Atlantic Research.

Atlantic Research announced on Oct. 23 that it would buy back up to 465,000 shares of its stock, a move that President William H. Borten said was not a protective measure.

Atlantic Research stock dipped to close at 18 1/4 on Oct. 28, compared with its 52-week high of $36 1/2. "It's relative value made it appealing," said Borten.

He said the company plans to grow both internally and by acquisition and that, in the past, it has made acquisitions by exchanging shares for a company. If the company acquires its own stock at a relatively low price, "it would obviously be to our advantage in days down the stream when it is at a higher value," said Borten. He added that was not the specific impetus for the repurchase plan, however.

In some cases, buying back shares increases per share book value by reducing the number of shares outstanding. Book value per share reflects a company's assets minus its liabilities divided by the number of shares outstanding.

Book value per share is sometimes a useful guide to underpriced stocks and indicates what a company's securities would be worth in liquidation. Thus, higher book value per share may make stock more attractive to investors.

Best Products Co. Inc., a discount retailer based in Richmond, has a book value of approximately $14.30, higher than the $13 top price that the company's stock has commanded during this year. Although the stock never closed below 7, it dipped as low as 6 on Oct. 20, said Mark Murphy, assistant vice president for corporate communication.

Best announced on Oct. 20 that it would buy back up to 2 million shares.

"We're one of the few retailers that have been selling below book for the whole bull market." The company, which suffered a $25.6 million loss in 1986, is in a turnaround, Murphy said. Even so, "we're a retailer that is not necessarily in favor on the street."

The company hopes raising its book value per share will make its stock more attractive to investors, but didn't begin a buyback earlier because it had a more pressing need -- to retire high-interest debt. Best spent about $50 million to buy bonds back, far more than it expects to spend on stock repurchase, he said.

Stock buybacks also affect earnings per share. Divided by fewer shares, earnings per share are larger.

In the case of Best, however, the buyback also will increase losses per share, at least in the near term. Best typically shows losses in the first three quarters of its fiscal year. Best's third quarter ended yesterday. The company has bought back about 300,000 shares.

Buybacks are generally set in terms of "up to" a certain number, with the total number purchased determined by the market price. Companies are not obligated to buy the number of shares that they set as their upper limits.

Companies are usually limited by the Securities and Exchange Commission in how, when and in what quantities they buy back stocks, to prevent firms from manipulating prices.

The SEC governs buybacks with "safe harbor" rules -- if firms abide by them, the SEC presumes they are not trying to manipulate prices. A company may choose not to abide by the rules, but loses that presumption of innocence and opens itself to a possible inquiry.

The SEC rules limit the number of shares that can be repurchased each day, and require firms to use only one broker dealer -- using more than one might create a misleading impression of widespread interest in its stock. The SEC rules also cap the amount a firm may pay for its shares, pegging it to the highest current independent bid for the stock or its last sale price, whichever is higher.

The rules also prevent a company from making the first trade of the day or trading in the last half hour.

Disclosures about repurchase plans are governed by the general SEC rules that require companies to disclose information of material interest to shareholders.

As of Friday, Hechinger had bought 50,000 shares of its Class A stock and no Class B stock. It has 35 million shares outstanding.

McClelland confessed to being a little torn by being both a buyer and seller of the company's stock. "One, you want to buy it at an advantageous price, and, two, you want to see the price go up," he said.