On Monday, ranch officials prevented Pinnacle workers from entering the property, telling them they would be in a “breach of the peace” if they tried to do so.

The conflict is the latest skirmish in a long war between ranchers and energy companies over a natural gas known as coal-bed methane. Technology created in the 1990s allowed producers to cheaply tap natural gas that occurs near the surface in underground coal deposits. That prompted a boom in the West, especially in Colorado, New Mexico and Wyoming.

The technology has also generated controversy in cattle country because of something called split estate. The Stock Raising Homestead Act of 1916 gave land to ranchers, but reserved the mineral rights underneath for the federal government, which leased it to energy companies. There are about 60 million acres of split-estate land in the West.

The Mars ranch has about 10,300 acres of federal mineral leases. While energy companies often reach an agreement over the use of a rancher’s land, they have the upper hand legally and the landowner cannot deny access.

The judge required Pinnacle to post a $10,000 bond for possible damages on the ranch.

The methane occurs in aquifers, and to get the gas, producers pump out huge volumes of water, strip out the gas and then dispose of the water. Mr. Mars, who according to Forbes magazine is worth about $14 billion and whose company, Mars Inc., produces Snickers and M&M’s, among other candies, has said he opposes the development because of the volume of water that would be pumped out.