Metro-Goldwyn-Mayer ( MGM) has reached a deal to sell its 20% equity interest in three Rainbow Media cable networks, AMC, the Independent Film Channel and WE: Women's Entertainment, to Cablevision Systems ( CVC) for $500 million. Cablevision sold the stake to MGM in April 2001. Rainbow will pay MGM $250 million in cash after closing of the transaction. The remaining $250 million will be in the form of a note issued by Cablevision that matures in five months. At that point, Cablevision will have the option to pay the note in cash or Class A common stock. The companies expect to close the transaction in the third quarter. MGM said it will report a book loss of about $93 million in the second quarter, which ends today. Rainbow Media, which manages national and regional cable networks, is wholly owned and operated by Cablevision. Shares of MGM were up 23 cents, to $12.56, on the New York Stock Exchange, and Cablevision was gaining 45 cents, to $21.56.