Nov 2 (Reuters) - CVS Health Corp on Wednesday forecast a 2023 profit below Wall Street estimates and said it hoped to mitigate the hit from a performance rating decline for its most popular Medicare plan by encouraging members to shift to other plans.

The company also announced it agreed to pay about $5 billion over 10 years to resolve thousands of lawsuits accusing its pharmacy chain of mishandling opioid painkillers. CVS took a pre-tax charge of $5.2 billion in the third quarter related to the settlement, a move that ends years of uncertainty for the company's finances.

The settlement price, which was below investor expectations, according to Evercore ISI analyst Elizabeth Anderson, and other measures announced by the company lifted CVS Health shares more than 4%

In its insurance business, CVS said it is trying to move members out of Aetna's National PPO plan, which currently accounts for 59% of its Medicare Advantage plan members.

"That has been part of our longer term strategy," Chief Executive Officer Karen Lynch said in an interview, explaining that the plan performance rating is manageable.

CVS' largest health insurance plan for Medicare recipients received a lower performance rating from the U.S. Centers for Medicare and Medicaid Services, which in turn could affect payments from the government for 2024, the company said last month.

CVS said the ratings decline and its loss of Centene's pharmacy benefit management (PBM) contract is expected to reduce 2024 revenue by $2 billion, although that figure could come down with company mitigation strategies.

The diversified healthcare company also disclosed that it is considering selling its Omnicare long-term care business, after last month announcing it will sell its bswift insurance software developer.

The company recorded a $2.5 billion charge related to Omnicare in the quarter.

CVS said it will repurchase shares to meet the 2024 earnings target it set last year, and that it is still open to acquisitions in healthcare services. Lynch described the company as looking for "the right capabilities at the right time."

The company earlier this year agreed to buy Signify Health for more than $8 billion.

"At our current valuation, an M&A deal is likely less accretive than share repurchase," Chief Financial Officer Shawn Guertin said during a conference call.

CVS forecast adjusted 2023 earnings of $8.70 to $8.90 per share, below Wall Street expectations of $9.06, according to Refinitiv data.

"While financial engineering is not the strongest way to meet its previously laid out plans, CVS shareholders will likely appreciate that double-digit earnings growth ... is still possible in 2024 and beyond," Morningstar analyst Julie Utterback said in a note.

CVS raised its 2022 profit forecast to $8.55 to $8.65 per share from it prior outlook of $8.40 to $8.60 on the strong performance of its health insurance and PBM business.

CVS' health insurance business as well as peers Elevance Health and UnitedHealth have benefited from a slow recovery in elective procedures and a fall in COVID cases that has kept costs in check. (Reporting by Leroy Leo and Nandhini Srinivasan in Bengaluru and Caroline Humer in New York; Editing by Vinay Dwivedi and Bill Berkrot)