Oil and natural gas companies benefited from bargain hunting Tuesday as investors snapped up the shares of companies whose market values have been knocked down to bargain-basement prices.

In late morning trading, Royal Dutch Shell plc, with a PE ratio of 6.97, jumped $2.50, or 4.17 percent, to $62.51, while ConocoPhillips, with an 8.6 PE, climbed $2.11, or 3.41 percent, to $64.03 and Exxon Mobil Corp., which has a PE ratio of 9.34, rose 92 cents to 71.11.

The ratio of a stock's price to its earnings in the last 12 months is a widely used metric to gauge the value of a company. Historically, the median PE ratio for the S&P 500 has been 15.7.

The gains followed a rise in the price of light, sweet crude oil on CME Globex. Crude oil for September delivery climbed 64 cents to $81.95.

The broader market also rose as investors picked up recently knocked-down equities. The S&P 500 increased 21.44, or 1.86 percent, to 1,140.32, the Nasdaq Composite added 56.31, or 2.39 percent, to 2,413.82 and the Dow Jones Industrial Average added 161.85, or 1.5 percent, to 10,971.70.

The gain in petroleum stocks was broad-based with integrated companies rising as strongly as those that have only exploration and production activities or only have refining and marketing operations.

Chesapeake Energy Corp., a large independent natural gas producer, jumped 85 cents, or 3.12 percent, to $28.05, while Valero Energy Corp., the largest independent U.S. refiner, soared nearly 7 percent to $19.58.