Masdar on Thursday agreed to pay 817 million euros ($887 million) for a 49.99% stake in 48 solar plants controlled by Endesa – a unit of Italy’s Enel – in Spain, with an overall capacity of 2 gigawatt.