Updated from July 29

Oil's surge helped ExxonMobil ( XOM), the world's largest energy company, post its best quarter ever Thursday and one of the most profitable three months in U.S. corporate history.

Exxon said second-quarter earnings shot up 39% to $5.79 billion, or 88 cents a share, matching the Thomson First Call consensus. Revenue rose 24% to $70.69 billion. Earnings in the company's enormous exploration and production unit rose by more than $1 billion to $3.85 billion, reflecting a 1% increase in oil and equivalents production.

In the company's downstream segment, earnings rose fivefold to $1.5 billion, reflecting higher refining margins offset by moderate weakness in marketing profitability.

"ExxonMobil is basically clicking on all cylinders," said Oppenheimer analyst Fadel Gheit, who recommends the stock and also owns it himself.

Gheit said all three of ExxonMobil's major businesses -- production, refining and chemicals -- are performing well in the current environment.

With crude futures hitting $43.05 a barrel -- a level previously unseen on the New York Mercantile Exchange -- Exxon joined a slew of energy companies that have recently raced to the market with news of gushing profits. ConocoPhillips ( COP), for example, posted a 75% jump in second-quarter profits after worldwide oil prices hovered near the $35 mark in recent months.

ConocoPhillips technically delivered a miss on Wednesday, however. Income from continuing operations came in a nickel shy of the consensus estimate at $2.88 a share.

Looking at the bottom line, the Houston energy giant earned $2.075 billion, or $2.97 a share, in the three months to June 30, compared with earnings of $1.187 billion, or $1.73 a share, last year. Revenue rose 25% to $31.9 billion

The company's stock slipped 5 cents to $76.42 after Tuesday's update. ExxonMobil also was down slightly, falling 4 cents to $45.37, despite the surge in oil prices.

Gheit said that investors were probably piling into oil production stocks -- which are more directly affected by current energy prices -- instead. He believes that investors will only start to favor oil majors like ExxonMobil after energy prices stabilize and the big producers, such as Apache ( APA) and Occidental ( OXY), start to look too risky. He is convinced that oil is carrying a "fear premium," totaling as much as $15, that will prove unsustainable in the long run.

"The producers are all enjoying unprecedented strength in oil and gas prices," said Gheit, who recommends only one producer -- Anadarko ( APC) -- due to its "attractive" valuation. "But watch out when prices start to moderate. Investors will dump these stocks faster than they bought them."

Meanwhile, Gheit views all of the super majors -- which he owns himself -- as good long-term investments. Jake Dollarhide, CEO of Longbow Asset Management in Tulsa, says his clients will certainly keep holding on to ExxonMobil at least.

Dollarhide does portray the sustained rise in oil prices as somewhat "miraculous." Like Gheit, however, he is convinced that ExxonMobil will continue to prosper even if energy prices drop.

In the meantime, Dollarhide applauded the earnings of one big producer -- Oklahoma-based Kerr McGee ( KMG) -- that's directly benefiting from the current spikes. He called Kerr McGee's second-quarter profits of $1.09 a share, which beat the consensus estimate by a penny, "impressive." The company also handily beat revenue estimates of $931 million by reporting sales of $1.1 billion.

Kerr McGee pointed to higher energy prices as a reason for its success. The company also highlighted its $3.4 billion acquisition of Westport Resources as a major achievement in the quarter.

Dollarhide says that Kerr McGee is "growing through smart, shrewd acquisitions" and has "transformed itself to a formidable global player." But Gheit strongly disagrees. Indeed, he promptly downgraded Kerr McGee from neutral to sell when the company announced its latest acquisition this spring.

Gheit believes that Kerr McGee is paying far too much for assets that will only depress the company's performance in a "more realistic" energy pricing environment.

"Companies only create shareholder value when they acquire reserves at prices below their IRV," or implied reserve value, he wrote in April. "Although the acquisition may be justified from a strategic point of view, as it balances KMG's reserves and production mix between on shore and offshore, we see no financial justification."

Still, Kerr McGee's stock has inched up slightly since Gheit issued his downgrade. The shares, which were trading for $51.51 at the time, climbed 21 cents to $52.24 on Wednesday.

Dynegy ( DYN) took a much bigger bounce. The company's stock jumped 5.6% to $4.15 on unexpected news of a second-quarter profit and projections of a profitable full year.

In an interview with TheStreet.com on Wednesday, Dynegy CEO Bruce Williamson also disclosed another favorable development. He said Dynegy had just learned that federal regulators have blessed the company's proposed $2.3 billion sale of Illinois Power to Ameren. A previous attempt to sell Illinois Power, Dynegy's regulated energy delivery business, failed to earn the necessary approvals.

Dynegy now plans to use proceeds from the asset sale to further reduce its debt load. In the meantime, the company reported "solid operational performances" from all of its major business lines. Technically, an $88 million one-time gain pushed both second-quarter earnings and full-year guidance into the black. But the company did report growth in its power generation business, natural gas liquids unit -- which was helped by "very strong commodity prices" -- and the regulated delivery segment it is now in the process of selling.

Dynegy also reported fresh progress with its restructuring efforts. The company is engaged in a major recovery plan following its near-collapse during the merchant energy meltdown two years ago.

"Our focus is on continuing our track record of solid performance and positioning the company for further improvements in the U.S. economy and power prices in general, with a goal of participating in future growth opportunities for our unregulated businesses," Williamson stated.

For now, Dynegy has already given investors an immediate reason to celebrate. The company posted a second-quarter profit of $10 million, or 2 cents a share, that reversed a massive loss of $290 million, or $1 a share, last year. It also projected profits of between 3 cents and 8 cents a share, rather than a loss of up to 20 cents a share, for the full year.

Prior to Wednesday's report, analysts were anticipating a 7-cent loss for the quarter and an 18-cent loss for the year from the company.

If you liked this article you might like

Lessons Learned From the Hedge Fund Crisis

Lessons Learned From the Hedge Fund Crisis

Why There's Still Hope for Detroit

Why There's Still Hope for Detroit

GM's Biggest Foe Could Be Time

GM's Biggest Foe Could Be Time

Humana's Learning to Change With the Times

Humana's Learning to Change With the Times

Health Insurers See 'Universal' Opportunity

Health Insurers See 'Universal' Opportunity