The natural gas shortage reached into Illinois and Indiana yesterday, extending its grip to 19 stages and closing factories in Chicago and the Indiana cities of Gary, Fort Wayne and Lafayette.

At the same time, Federal Power Commission Chairman Richard L. Dunham Gas Emergency Act in moving surplus West Coast gas through a pipeline in Texas that had been legally unable to carry the gas before the law was signed.

Dunham signed an order yesterday that will move 150 million cubic feet of gas a day out of Oregon and Washington through pipelines in California and on into Texas, where the first gas was passed on to Transcontinental Gas Line Corp. within hours. Transco serves eastern seaboard from North Carolina to New York.

That is nowhere near enough gas to get the eastern two-thirds of the country through its current crisis, but the FPC hopes it will be the first of many emergency gas sales to ease the crisis. The United States has been burning almost 100 billion cubic feet of gas a day this winter, most of it in a 17-state region that runs roughly from New York to Mississippi.

President Carter has said he would like to see a temporary halt to natural gas regulation for a "limited period" up to four years, but new Federal Energy Administrator John F. O'Leary sounded a different note yesterday when he said he was not sure deregulation would produce any new natural gas supplies.

"If I were dealing only with energy, I would urge that you deregulate natural gas, but the state of the economy tends to moderate that conclusion," O-Leary told reporters before his appointment was confirmed by the Senate. "We are already suffering from energy inflation, which deregulation would not help."

In spreading beyond those 17 states in to Illinois and Indiana, the shortage caused Peoples Gas Light & Coke Co. of Chicago, Indiana Gas Co. and Northern Indiana Public Service Co. to cut gas flow to factories. The Indiana utilities asked all gas-burning offices and stores except drug stores in the northern third of the state to close down through the weekend.

Steel mills in Gary were told the only gas they would get would be gas to keep their pipes from freezing, a move that closed or cut production at four of the five major mills. The big United States Steel mill in Gary stayed open by burning gas being made as a by-product in the coke ovens, but it laid off and furloughed as many as 1,000 workers because of the gas cutoff.

Indiana Gov. Otis R. Bowen estimated that 3,100 factories were closed and 60,000 people were out of work in his state. No figures were available from Illinois.

The Commerce Department, which has been gathering figures on unemployment triggered by the gas shortage, has been as far as a week behind plant closings in coming up with those statistics. Commerce estimates there are 1 million people out of work because of gas-short factory closings.

In a telegram to FPC Chairman Dunham, Gov. Bowen said he is concerned that the steel mill layoffs will snowball into other industries that need steel to operate.

Bowen said that February and March are the peak production months for campers and mobile homes built in Indiana factories, which he said do not have large enough steel inventories to take them through the two months.

Illinois and Indiana started feeling the gas pinch for the same reason that the states to their east and south have felt it. The coldest winter in more than 90 years has drained the gas storage fields in Illinois and Indiana, causing pipeline pressure to drop and giving the gas distributors no choice but to force factory customers off the line.

In another federal action yesterday, Treasury Secretary W. Michael Blumenthal waived for the second time in two days a federal law that requires that cargo be carried between two U.S. ports by a U.S. ship.

The waiver freed a Panamanian vessel from the restrictions of the Jones Act to make five shipments of 34,700 barrels of liquid propane from Houston to the Virginia port city of Chesapeake. Each shipment will take the vessel Tropigas 14 days to complete.

Virginia is one of 11 states that the FPC has said are the most seriously hit by the shortage. Besides Virginia, they are New York, New Jersey, Pennsylvania, Ohio, Tennessee, North Carolina, South Carolina, Georgia, Mississippi and Alabama.

In addition to Illinois and Indiana, the other states short of gas are West Virginia, Kentucky, Michigan, Maryland, Delaware and Wisconsin.

The new Natural Gas Emergency Act is designed to allow the President to move gas from one interstate pipeline to another. It also extends from 60 to 180 days the time interstate pipelines can buy "emergency" gas from intrastate pipelines, where gas is not regulated by the FPC but where prices are almost twice what interstate prices are.

The idea of the 120-day extension is to encourage gas producers to sell their gas to interstae pipelines, which are hardest hit by the current shortage.

The new emergency legislation allowed the FPC to break a bottleneck in Texas, where West Coast gas had been bought but could not be moved by Transco because contracts between a Texas pipeline and its intrastate customers prohibited commingling of interstate and intrastate gas. The legislation voided such provisions.

In his remarks to reporters yesterday, Federal Energy Administrator O'Leary said the White House should consider other long-range options besides deregulation as a way to soften the shortage. He said that partial deregulation of only new gas might be an option and that new taxes on windfall profits could be another way to keep prices from soaring if deregulation came.

"People have said that driving the price up would drive the so-called switch hitters off the natural gas lines and increase supplies," O'Leary said. "My own judgment is that you won't do much of the latter, because there just isn't that much gas to be found."

By switch-hitters, O'Leary meant the factories that burn gas for heat because it is clean and cheap, then move to higher-price oil for their heat when gas shortages like this one came along.

In another development yesterday, the governors of Connecticut, Pennsylvania and Kentucky and the lieutenant governor of Massachusetts told Congress that the harsh winter is forcing millions of people to choose between buying food and fuel.

"All that is needed is an emergency appropriation to pay the cost of something now causing millions of Americans to choose between 'eat and heat,'" Pennsylvania Gov. Milton Shapp told the Senate Subcommittee on Intergovernmental Relations. "I want to suggest that $500 million would be sufficient to accomplish this."