Coastal Gas Corp. of Houston abruptly withdrew yesterday as the hostile suitor for Texas Gas Resources Corp., clearing the way for CSX Corp. of Richmond to consummate its billion-dollar "white knight" takeover.

Coastal, however, accepted as a consolation prize $18 million from Texas Gas to pay the expenses of its takeover bid and will sell its 528,900 shares of Texas Gas stock to CSX at the takeover price of $52 a share--bringing it an additional $27.5 million. Reportedly, Coastal paid an average of $35 a share for its stock.

"Buying peace is sometimes easier, cheaper and cleaner," said a Wall Street expert in takeover cases.

The merger unites CSX, the nation's largest railway system, with Texas Gas, which runs gas pipelines as well as trucking, barge transportation, boat building and oil and natural gas exploration operations.

CSX's $52-a-share offer, part of its $1.07 billion bid for Texas Gas, opens at midnight Wednesday.

CSX expressed pleasure at Coastal Gas' sudden decision to drop out of the bidding for Texas Gas, which came as a surprise to Wall Street analysts and stock speculators. As recently as this Wednesday night, Coastal said it would sweeten its most recent, $1.05 billion offer for the Houston company, driving Texas Gas stock up past the CSX bid of $52--to $54.50.

The stock dropped 87.5 cents yesterday to $53.625 on news that Coastal had quit the takeover battle. CSX also dropped slightly, 37.5 cents to $70.50, while Coastal gained 25 cents to $27.25.

As part of the agreement between the three companies, Coastal said it would not buy any Texas Gas stock for the next five years.

Furthermore, Coastal, CSX and Texas Gas agreed to drop all lawsuits arising from the takeover. In addition to the lawsuits, Coastal also has filed petitions in Washington urging the Interstate Commerce Commission to fight the merger. The Justice Department said Wednesday it saw no antitrust problem with a CSX-Texas Gas merger.

It is unclear how much the takeover attempt cost Coastal, although Wall Street experts in takeovers said it is unlikely that the 2 1/2-week battle cost as much as the $18 million it received from Texas Gas, even with the extensive litigation and the appeals to regulatory agencies.

But, the expert added, "There's some precedent for paying money just to be rid of people. There's a lot of incentive to buy peace."

Moreover, last fall's protracted and expensive Bendix-Martin Marietta takeover battle "left such a bad taste" in corporate headquarters that there now appears to be a trend toward getting mergers over quickly rather than allowing them to drag on.

Although CSX is almost certain to complete its takeover, it still must pass one regulatory hurdle, the ICC, which must approve any railroad owning a barge line.

Until CSX wins that approval, Texas Gas' barge subsidiary will be placed in a voting trust.