The Civil Aeronautics Board flew into the sunset yesterday to the soulful notes of a lone Marine bugler playing "Evening Colors," the tune sounded during sunset flag lowering ceremonies at U.S. military bases throughout the world.

"I declare the Civil Aeronautics Board closed forever," said CAB Chairman Dan McKinnon, banging a gavel that had been given to him by Sam Rayburn, who in 1938 introduced the bill setting up the agency. McKinnon had been a page for the former House Speaker.

Then Lance Cpl. Robert Gibson of Columbus, Ohio, part of the Marine color guard participating in the closing ceremony, sounded his bugle. When Gibson hit the last notes, Alan M. Pollock, the CAB's public affairs director, took the agency seal down from the wall for donation to the Smithsonian Institution.

It was a bittersweet final meeting for the CAB, the first federal regulatory agency ever to go out of business. Vice Chairman Barbara E. McConnell suggested that the government follow the CAB's example with other agencies, although it appears some of the steam has gone out of the Reagan administration's drive to eliminate them.

McKinnon, who took over as chairman three years ago determined to close the CAB within a year, praised the agency, saying it had "nursed the airline industry" for 46 years. "Now the airlines are on their own," he said.

McKinnon said the industry is healthier than it has been in a decade and is heading for a $2 billion profit this year.

But airline deregulation, which was started during the Carter administration and picked up by the Reagan White House, also brought bankruptcy to major carriers, a bewildering array of fares for the traveling public and steep price increases for fliers on less heavily traveled routes. And it lessened the number of direct flights between cities and encouraged airlines to set up hub-and-spoke systems, in which passengers fly to a major airline hub, such as Newark, N.J., and transfer to planes that take them to their final destinations. McKinnon said this system was more efficient than the old one.

Because of the changes, McKinnon said, airlines now are able to operate in a free and open market instead of under heavy government regulations that set fares and determine routes. As one of its final major decisions, McKinnon said, the CAB decided to allow tickets to be sold by almost anybody -- supermarkets, department stores and rental car agencies, for example -- instead of restricting sales to travel agencies and airline representatives.

He emphasized that the CAB's consumer protection functions -- resolving overbooking problems, finding lost luggage, and enforcing charter protection and no-smoking rules -- will be taken over by the Department of Transportation.

"I don't think the consumer is going to notice anything different other than a change of address," said McKinnon, a former Naval Reserve pilot and radio and TV station owner.

But not everyone agreed. J. Welch Pogue, who chaired the CAB from 1942 to 1946, called closing the agency "not a good idea" and said deregulation was "done too vigorously.

"Here was an agency that, along with the industry, developed the best air transportation system in the world," he said in an interview. "Now we have an open situation where there are no legal fares. The little fellow doesn't know if he's paying the right fare or not."

Pogue also complained that fares on shorter and less popular routes have skyrocketed and that no federal agency protects new airlines from entrenched carriers that don't want to surrender a share of the market.

Pogue, the only person still living who served on the CAB that long ago, attended its final meeting yesterday, as did one other former chairman of more recent vintage, Marvin S. Cohen.

Sunset was a major theme for the CAB. The cover of its last annual report, released yesterday, showed the agency's official seal sinking behind a hill, casting beams across a lake. A plane flew overhead saying "Bye, Bye." CAB officials also passed out a booklet entitled "Flight into Sunset," which listed the agency's accomplishments over the past 46 years.

For an agency going out of business, 1984 was a busy year. The annual report said it was the CAB's busiest year for handling discrimination complaints by U.S. airlines against foreign carriers.