The shale revolution in North America has unleashed a burst of oil and gas production, and it shows no signs of abating. This unanticipated surge in production hasn't spread in neighboring Mexico yet. Mexico is a silent observer in the shale revolution unfolding in the U.S., while a lack of deepwater drilling technology prevents the country from exploiting its hard-to-reach deepwater oil reserves. 

What?
As a result, Mexico is one of these nations that has been struggling to keep up its oil and gas production. Although the country is one of the 10 largest oil producers in the world, the amount of oil produced in Mexico has been on a steady decline since 2004 due to natural production declines from Cantarell, Ku-Maloob-Zaap, and other large offshore fields. Oil output has dropped from 3.4 million barrels per day (bpd) in 2004 to 2.5 million bpd, and Mexico currently imports half the petrol it consumes.

Mexico is an importer of natural gas too. The U.S. is Mexico's largest supplier of natural gas, and U.S. shipments to Mexico account for a little less than 3% of U.S. production. Some estimate that U.S. gas exports to Mexico will double by 2017 because Mexico's natural gas consumption is increasing, and the need for new supplies of gas is steadily growing.

Meanwhile, Mexico has the world's fourth largest shale gas reserves, with 681 trillion cubic feet of recoverable reserves plus a further 13 billion barrels of recoverable shale oil reserves, according to the U.S. Energy Information Administration. 

So what?
Mexico had to face this energy shortage, but Pemex didn't have enough cash and technical expertise to fund the development of Mexican oil and gas resources. So the shake-up of Pemex and the opening of oil and gas exploration and production to foreign companies took place a few days ago.

Last week, President Nieto signed a law that opens Mexico's oil industry to foreign investment for the first time in 75 years. The "game changer" bill modifies three articles of Mexico's constitution, aiming at attracting foreign investment with profit and production-sharing contracts. Under the previous status quo, Pemex's private partners hadn't any incentive to take risks because Pemex was paying them not "in kind" (i.e. a percentage of extracted oil and gas) but in cash.

Major international companies have required such provisions as a condition of investing in the Mexican oil and gas industry. President Nieto calls these energy reforms "the grand transformation" that aims at shoring up the Mexican economy, reducing violent crime, upending the public school system, and increasing tax collection, as Pemex's revenue funds a third of government operations. 

Now what? 
How can an investor benefit from these reforms that will unlock Mexico's oil and gas potential? Which companies will benefit from the radical transformation of Mexico's energy sector? Being an early mover is a strategic advantage in cases like this, where the private investments go across the entire hydrocarbon value chain from drilling all the way down to refineries and pipelines. 

Key Energy Services (NYSE:KEG) is an oilfield-services company with significant exposure to Mexico, where it generates almost 10% of its total revenue. Key's patented KeyView system has played a critical role in winning initial direct assignment from Pemex because it delivers cost reductions to customers while improving safety and efficiency.

However, the company's presence in Mexico was problematic in 2013 because of the extreme dependence on its work with Pemex. Revenue and margins were adversely affected by Pemex's budgetary constraints, and Key had to reduce its operating costs as the utilization rate of its Mexican rigs dropped to approximately 50%. Nevertheless, Key estimates that this disruption is short term, and management expects their Mexican services to come alive in early 2014 because a significant backlog of wells in the area will soon need servicing.

Mexico's current pipeline network is clearly insufficient, and TransCanada (NYSE:TRP) is well positioned to benefit from this lack of infrastructure. In the 1990s, TransCanada built the Mayakan and the El Bajio pipelines, which were the first non-Pemex pipelines in Mexico.

In 2009, TransCanada was the successful bidder on a contract to build, own, and operate the Guadalajara pipeline in Mexico. The Guadalajara pipeline followed a 193-mile route from Mexico's Pacific Coast to Guadalajara, the second largest city in Mexico. This Canadian firm also owns and operates the Tamazunchale Pipeline in central Mexico.

TransCanada's CEO sees opportunities to build new oil pipelines in Mexico and emphasizes the company's expertise in "startling topography," which includes difficult terrain and mountain ranges.

The reevaluation of budgeting by Pemex hit TETRA Technologies (NYSE:TTI) too. TETRA provides a wide variety of oilfield services and saw a significant reduction in its Mexican activities in the first half of 2013. Things started to change in the third quarter of 2013 when TETRA saw a slow increase in activity. It expects this trend to continue through Q4 2013 and into 2014. TETRA is optimistic and remains confident that Mexico will be a major contributor to the company's growth in the intermediate-to-long term.

TETRA is also the majority owner and general partner in Compressco Partners. When TETRA opens the door with a customer through production testing or other services, Compressco follows up with well enhancement services. In 2013, Compressco continued its international expansion to liquids-rich shale plays and invested significant capital in Mexico, where it anticipates a slow recovery effective 2014. 

Foolish bottom line 
Despite Mexico's untapped deposits in shale-rock formations, Mexico's nationalistic approach has resulted in an energy shortage amid booming industrial demand and dwindling output from the domestic oil and gas fields. Fortunately, Mexico took the decision to make some reforms and allow more experienced foreign players to develop its resources. This stunning change can trigger an economic boom in Mexico and materially affect the operations of the companies mentioned above.

Nathan Kirykos has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.