The machines that normally test about 500 cigarettes a day for the Federal Trade Commission went cold turkey yesterday.

Other FTC work stopped just as abruptly as the agency went about the process -- almost unprecedented in the government -- of shutting down for lack of funds.

But even as the controversial agency was shutting its doors, Congress was moving to rescue it.

Both the House and Senate passed funding bills in late afternoon that should restore FTC to normal operations by early next week.

Impetus for that action began Wednesday when a House-Senate conference passed the FTC's authorization bill.

The consumer agency ran out of spending power Wednesday.

Federal marshals promptly showed up in at least two FTC regional offices late Wednesday afternoon armed with a General Services Administration directive.

"On April 30, 1980, at 1345 hours, this office was advised that the attorney general ruled that the Federal Trade Commission is to be terminated," said the message sent by the Federal Protective Service to its field offices.

The service was ordered to "coordinate and provide security" for the FTC sites. "Nobody was aware of the magnitude of this thing until they showed up," said one official who greeted the guards. "That was the first realization that this was something a little different."

And a little different it certainly proved to be as commission business ground to a halt yesterday.

Hearings, a court appearance, travel and even the normally heavy flow of mail out of the commission halted, as FTC investigators scurried home from investigations and callers to the FTC's reference room were hooked up to a recording. "The commission is closed as of May the first 1980 due to lack of congressional funds," the recorded voice said.

FTC Commissioner Paul Rand Dixon said the mood at headquarters -- where 1,100 of the FTC's 1,600 employes work -- could be characterized by "confusion."

"We've been doing just what Congress told us to do all along, and we're doing more of the same today," Dixon said as he and aides sorted through documents.

"It's basically idiotic," said FTC Chairman Michael Perschuk, who spent much of the day talking to reporters. "It's a waste of taxpayers' dollars," Pertschuk noted, citing the added travel expenses that the shutdown would entail.

High commission officials spent the day sorting through documents to determine which were confidential and would have to be turned over to federal security personnel.

"On Monday we'll begin deciding which investigations should be closed and which should be referred to other agencies," said Alfred Doughtery, head of the FTC's Bureau of Competition, before yesterdays congressional action.

Lower-level staff members were worried about their duties and paychecks."It's just degrading," said Sue Hendsey, FTC's chief librarian. "Morale is low, to say the least."

The bizarre situation arose after attorney General Benjamin Civiletti ruled that federal agencies like the commission could not continue without a formal funding bill.

The FTC's funding, which has been temporary for three years, lapsed with the close of business Wednesday. The House Appropriations Committee has repeatedly warned that temporary funding would not be adopted this year unless Congress passed an authorization bill.

That lesiglation, which was approved by a House-Senate conference committee Wednesday, cuts back the powers of the commission, stopping one commission initiative and limiting others.

With that development, the House Appropriations Committee voted yesterday morning to grant the FTC $7.6 million to keep it in business. The House passed the resolution by 284 to 96, before the Senate approved, 71 to 10.

President Carter signed the bill yesterday evening.

Carter aides were also reviewing the authorization bill, particularly the conference committee's report. The report was the target of a feverish lobbying effort late Wednesday, with lobbyists representing advertising and sugar interests trying to promote language that could be used later in court challenges to commission activities.

The controversial authorization bill sets new guidelines for the FTC's funeral industry rulemaking, its handling of issues related to insurance, advertising directed at children and recommends that a three-agency panel be established to review FTC authority over agricultural cooperatives.