Houston-based Linn Energy LLC has agreed to buy Berry Petroleum Co. -- a big player in Kern County's oil industry -- in a stock-for-stock deal valued at $4.3 billion, the companies announced Thursday.

Berry is a mid-size oil and natural gas producer that moved its headquarters from Bakersfield to Denver in 2008. It still has substantial operations in California, as well as in Texas, Utah and Colorado.

"Today's merger announcement with LINN Energy marks the beginning of a new, important chapter in our company's history," Berry President and CEO Robert Heinemann stated in a news release.

The proposed deal is expected to be finalized in June following various shareholder and regulatory approvals. Already it has been approved by the governing boards of each company, including LinnCo LLC, created by Linn Energy to help it grow and expand.

Bloomberg reported that the transaction is the biggest oil and gas purchase to be announced this year, and Linn's biggest ever.

Soon after Thursday's announcement, at least three law firms specializing in shareholder rights announced they were investigating whether the transaction would represent a fair deal for Berry's stockholders.

According to Thursday's announcement, Berry shareholders would receive 1.25 common shares of LinnCo for every Berry share they own. It values Berry stock at $46.24, a premium of about 20 percent over Wednesday's closing price. LinnCo would then sell those shares to Linn Energy.

For Berry shareholders, the transaction is expected to be tax-free.

Analysts for Tudor Pickering Holt & Co. wrote in a note to clients Thursday that the proposal "makes sense given Berry's portfolio," Bloomberg reported.

But New York law firm WeissLaw LLP questioned that valuation, saying in a news release, "The offer price is a significant discount to Berry's 52-week high of $57.26."

Berry shares closed Thursday at $46.02, up more than 19 percent according to Yahoo! Finance. Linn Energy's stock rose less than 3 percent to $37.68.

Linn Energy is a publicly traded company that focuses on buying older oil and natural gas fields. It was formed in 2003.

Berry is active in the aging but prolific diatomite oil formations near Taft. Under pressure from state oil regulators, it has had to re-engineer its approach to heavy oil production in the area.

Initially that work, done mostly in 2012, went poorly and led to the closure of multiple wells in western Kern. But in August the company reported strong progress in well monitoring and steam control work, with Heinemann saying wells there were "starting to work again."