General Motors Corp. announced yesterday it will sell its Hughes Aircraft Co. division to Raytheon Co. for $9.5 billion. The deal transforms Raytheon overnight from a conservatively run New England conglomerate into the world's third-largest military contractor.

The sale of Hughes probably is the last huge deal in the wave of defense mergers that has reshuffled the entire U.S. aerospace industry in the last four years. Raytheon emerges as one of the world's two top military electronics firms; the other is Bethesda-based Lockheed Martin Corp. The other defense colossus is Boeing Co., which last month announced a proposed $13 billion purchase of McDonnell Douglas Corp.

The outcome was a painful blow to Northrop Grumman Corp., which struggled furiously to win GM's auction of Hughes but now faces the possibility of eventually falling into the ranks of subcontractors dependent on the three big defense players for work.

Founded in 1932 in a Los Angeles hangar, Hughes Aircraft started out as a team of accountants tracking the expenses of aviation pioneer Howard Hughes as he pursued his dangerous hobby of racing military planes. It went on to make important breakthroughs in satellites, radar and high-technology communications.

The sale completes the unraveling of the high-tech acquisitions by former GM chairman Roger Smith in the mid-1980s. Besides buying Hughes in 1985, Smith also purchased Electronic Data Systems Corp. from Ross Perot. GM later paid the disruptive Perot $750 million to leave the company, and last year it spun off the data consulting firm.

GM's sale of Hughes is one of the most complex in memory, investment bankers say, because GM sought to minimize taxes and because Hughes Aircraft is part of GM's Hughes Electronics Corp., which offers its own class of stock.

GM stockholders will control 30 percent of the shares in Raytheon, which will have a projected annual revenue of $21 billion and 127,000 employees. In addition, Delco Electronics, another division of Hughes Electronics, will be folded back into GM.

GM officials said most of the sale's proceeds will go to Hughes Electronics, which remains a part of GM -- it builds commercial satellites, runs cellular telephone networks, and, using the name DirecTV, offers satellite television service using small rooftop dishes.

But the deal is most striking in the way it reshapes Raytheon, based in Lexington, Mass. Only a week ago, it announced a $3 billion deal to buy Texas Instruments Inc.'s defense division, which enabled it to argue that it, more than Northrop Grumman, had the critical mass in defense work to make a Hughes deal work.

Now Raytheon will become the world's dominant missile builder -- which is certain to trouble antitrust agencies. Raytheon, which purchased highly classified E-Systems Inc. for $2.3 billion in 1995, also will be one of the nation's top contractors in spy satellite, surveillance and intelligence work.

Dennis Picard, Raytheon chairman and chief executive, said yesterday he will "work with rigor and vigor" to explore spinning off its engineering and construction division, which is one of the nation's biggest, and its consumer products unit, which makes Amana ovens and Speed Queen washers. Picard has said these units contained "trapped value," meaning Wall Street didn't recognize their true worth while crammed into Raytheon.

"In just over a year, Raytheon has completely transformed its future business focus," said Loren Thompson, a defense industry fellow at the nonprofit Alexis deTocqueville Institution. "A somewhat sleepy conglomerate has been transformed into one of the largest defense companies in the world."

Raytheon's core, defense electronics, is a growth business, unlike the business of "metal-bending" to manufacture jets or tanks. Lockheed Martin Chairman Norman Augustine points out that while 1 percent of the cost of a World War I combat plane was devoted to electronics, in World War II it was 10 percent, in the Vietnam War it was 35 percent, and now it's 45 percent.

That's one reason Northrop Grumman battled so fiercely to buy Hughes. Northrop has grown fast through a string of universally praised mergers. But Raytheon beat it yesterday in part because Raytheon is so much bigger, and could more easily finance the $5.1 billion in stock transferring to GM, plus $4.4 billion in debt.

Because GM would end up as a stockholder in the acquiring company, the auction was a sort of beauty contest in which Raytheon and Northrop Grumman each argued its stock would do better with a Hughes purchase. Northrop argued, for example, that its stock has grown twice as fast as Raytheon's over the past five years, and that it has excellent growth prospects.

Picard declined to comment on possible layoffs, but industry analysts said they are inevitable, especially in the missile sector.

In particular, they said Raytheon may move missile work from New England to Hughes's lower-wage plant in Arizona. That surely would anger Massachusetts officials, who in 1995 gave in to Raytheon's demands for large tax benefits to persuade the company to stay put.

"Raytheon will certainly look at" the option of moving, one knowledgeable industry executive said. "But they don't want to anger the entire New England congressional delegation, particularly when the new defense secretary {retiring Sen. William Cohen of Maine} is from there." THE HUGHES HERITAGE Among Howard Hughes's various passions were aircraft. Here are some events leading up to his creation of Hughes Aircraft. * In 1916, at age 11, Hughes built a radio transmitter and receiver from parts taken from his home's doorbell. * As a teenager, he became fascinated with aircraft after persuading his father to take him on a flight in a seaplane. * At 19, he inherited 75 percent of his father's Hughes Tool Co. He persuaded a judge to waive his status as a minor and he took control of the company. * At 20, he became a movie producer and won two Academy Awards for the 1928 film "Two Arabian Knights." * At 27, he bought a Boeing P-12 military pursuit plane to race, and formed Hughes Aircraft to keep track of expenses for his plane-racing hobby. * At 31, he set a transcontinental speed record from Burbank, Calif., to Newark, in a modified Northrop Gamma. * At 41, he was seriously injured while testing an XF-11 photo-reconnaissance plane built for the Army Air Corps. * In 1953, Hughes Aircraft was incorporated as a separate business. The firm went on to develop key technologies in satellites, radar and communications. Hughes established the Howard Hughes Medical Institute, donating all Hughes Aircraft stock to it to provide funds for medical research. * In 1985, the Howard Hughes Medical Institute sold Hughes Aircraft to General Motors for $5.2 billion. CAPTION: Howard Hughes in 1947 in his flying boat, the Spruce Goose.