LONDON (Reuters) - AstraZeneca (>> AstraZeneca plc), under pressure from falling sales of older drugs, is selling a medicine for a rare type of cancer to Sanofi (>> Sanofi) as it continues a drive to raise cash by divesting certain assets.

Sanofi's rare diseases division Genzyme will pay AstraZeneca up to $300 million (193 million) for global rights to Caprelsa, including an upfront payment of $165 million and milestone payments based on the drug's performance of up to $135 million, the companies said on Monday.

Caprelsa is sold in 28 countries for treating medullary thyroid carcinoma and had sales last year of $48 million.

AstraZeneca, which said the transaction was expected to complete in the second half of 2015 and would not impact its financial forecasts for the year, said Caprelsa was better suited for a rare disease specialist such as Genzyme.

Earlier this month the British drugmaker struck another "externalisation" deal to help fill its short-term revenue gap by divesting a gastrointestinal drug for $215 million.

With AstraZeneca reporting second-quarter results on Thursday, analysts expect such deals to prop up the company's results through 2015.

Chief Executive Pascal Soriot argues that selling off non-core drugs will help the company's finances and allow it to invest in its promising pipeline of new medicines, but some analysts are worried about its reliance on such deals.

The issue came to a head in April when AstraZeneca said it was getting a $450 million windfall by letting Celgene (>> Celgene Corporation) develop a prized immunotherapy drug for blood cancers.

Soriot has also struck cash-generating externalisation deals with Eli Lilly (>> Eli Lilly and Co) and Daiichi Sankyo (>> DAIICHI SANKYO COMPANY, LIMITED).

(Reporting by Ben Hirschler; editing by David Clarke)