The shift to shales — and the rise in oil prices — has lifted the domestic rig count close to 20-year highs and shifted the landscape, helped several states join Texas, Oklahoma and Louisiana in the chase for natural gas and oil production, according to Headwaters Economics.

In late May nationwide oil and gas drilling activity was at 91% of its 20-year high, last reached in 2008 when 2,031 gas rigs were in operation, the firm said in a new report. The domestic rig count has steadily recovered from a June 2009 low of 875 total rigs. Baker Hughes Inc. reported that as of June 17 the total oil and gas rig count stood at 1,860.

“Oil and natural gas drilling activity has made a strong recovery since reaching a recession-induced low in late 2008,” said the report’s author Julia Haggerty. “Market prices and advancements in drilling technology account for most of the increases in drilling activity.”

Using rig count data from Baker Hughes and price data from the Energy Information Administration, the Bozeman, MT-based firm completed a graphical analysis of the trends in drilling by energy type compared to market prices; drilling rig activity by technology type; and state trends.

Texas, Oklahoma and Louisiana continue to dominate onshore drilling, with 63% of all land-based drilling activity occurring in these three states at the end of May, the report said. However, North Dakota’s Bakken Shale and the might of the Marcellus in Pennsylvania have changed the landscape.

“Another striking trend is the expansion of rig activity in North Dakota and Pennsylvania, trends that underlie the strength of price in driving the location of drilling activity,” said Haggerty. “While both states are undergoing a boom, the rig count in North Dakota — where the target is oil — has quadrupled since mid-2009. In Pennsylvania — where the target is shale gas — the rig count has doubled since mid-2009. As of May 27, 2011, North Dakota claimed 9% of all land-based rig activity in the U.S., Pennsylvania 6%.”

In the Rocky Mountain states, the share of drilling hasn’t changed, but the western states now rely on unconventional oil, noted the report.

Rig numbers doubled between 2002 and 2008 in Colorado, Montana, New Mexico, North Dakota, Utah and Wyoming — reaching a 20-yer high of 434 in November 2008, said the report. From December 2008 through June 2009 the rig count declined, but since then drilling has steadily increased, reaching 391 in late May.

Recent drilling trends in the Rocky Mountains demonstrate “the strong role of price and technology in determining the viability of extraction activity in unconventional resources. Rigs have moved between states, as between New Mexico and Colorado, as known plays such as coalbed methane in the San Juan Basin have matured and newer plays like natural gas fields in the Piceance Basin have emerged.

“Meanwhile, since the recession, oil has been the key factor leading the return of rigs, with North Dakota now claiming a larger share of rig activity than did any other state in the region even during the height of the 2003-2008 boom.”

Haggerty said “there is little evidence that state and federal regulations are hampering industry’s ability to respond to market signals. Price and the ‘primeness’ of resource plays, determined by how well resource qualities fit with drilling and production technology, are the key drivers of the location of drilling. That drilling activity has recovered so quickly, and the location of new activity, suggest strong capacity on the part of industry to respond to market opportunities.”

Domestic oil drilling escalated as prices tripled between early 2009 and May 2011, but gas prices haven’t recovered from since their 2008 highs, which is reflected in the turnabout in the rig count. Only about 15% of all active rigs from 2004 to 2008 were drilling for oil, but the share of oil rigs actively drilling has climbed steadily since late 2009 from 30% to more than 50% today.

Location and the “pace” of drilling are sensitive to several factors, “primarily price, but also technology and the discovery of new resource plays,” said Headwaters Economics. “Drilling activity can shift quickly between geographies and resource types. The mobility of drilling activity helps to explain why energy-producing areas can be so hard hit by boom-bust cycles of energy development.”