(Reuters) - SunEdison Inc (>> Sunedison Inc) agreed to buy Vivint Solar Inc (>> Vivint Solar Inc), the second-biggest U.S. solar panel installer, in a deal valued at about $2.2 billion, speeding up its expansion in the booming residential solar market.

Demand for Vivint's residential solar systems has soared as the company that went public last October allows homeowners to lease its systems rather than buying them outright. A decline in equipment costs has also helped.

The distributed generation business, or power produced for local consumption, is expected to contribute about 28 percent of SunEdison's 2016 revenue, post acquisition, from an estimated 18 percent in 2015, S&P Capital IQ analyst Angelo Zino said.

Installers command higher margins from the residential solar market than more aggresively priced utility-scale projects.

Vivint, controlled by Blackstone Group LP (>> Blackstone Group LP), operates in seven states, including California and New York.

SunEdison will give Vivint stockholders $9.89 in cash, $3.31 in stock and $3.30 in notes for every share held. The offer works out to $16.50 per share — a 51.7 percent premium to Vivint's Friday close.

Vivint shares jumped as much as 46.4 percent to $15.93 on the New York Stock Exchange on Monday. SunEdison shares were up 2.9 percent at $32.48, after touching a near-seven-year high of $33.44.

SunEdison also said its unit TerraForm Power Inc (>> TerraForm Power Inc) would eventually buy Vivint's rooftop solar portfolio of 523 megawatts, expected to be installed this year, for $922 million.

The offer works out to four times Vivint's retained value of $560 million as of March 31, said Raymond James analyst Pavel Molchanov.

Retained value, a metric commonly used by solar firms, is the value of income from future electricity sales minus costs.

The deal sent shares of SolarCity Corp (>> SolarCity Corp), the No. 1 U.S. solar panel installer, soaring up as much as 8 percent.

TerraForm Global Inc, a SunEdison yieldco, on Monday said in a regulatory filing that it expects to raise $1.19 billion in an initial public offering.

The company is offering 56.6 million Class A shares, expected to be priced at $19-$21 per share. SunEdison will continue to control it after the offering.

TerraForm Power Inc, SunEdison's first yieldco, raised about $502.5 million in its IPO last July.

BofA Merrill Lynch advised SunEdison, while Morgan Stanley & Co LLC acted as Vivint Solar's adviser.

(Writing by Swetha Gopinath; Editing by Sriraj Kalluvila and Joyjeet Das)

By Anannya Pramanick and Shubhankar Chakravorty