Exhibit 10.4



 Exhibit 10.4 

SunEdison, Inc. 
 13736 Riverport
Drive 
 Maryland Heights, Missouri 63043 

December 9, 2015 
 TerraForm Power, LLC 

7550 Wisconsin Avenue, 
 9th Floor Bethesda, 

Maryland 20814 
 Attention: General Counsel 

VIA EMAIL 
 RE: Term Facility, Take/Pay and IDR
Letter Agreement 
 Ladies and Gentlemen: 

In connection with the proposed acquisition of Vivint Solar, Inc., a Delaware corporation (the “Company”), by SunEdison, Inc.,
a Delaware corporation (“Parent”), whereby SEV Merger Sub Inc., a Delaware corporation and wholly-owned subsidiary of Parent, will merge with and into the Company (the “Merger”), Parent, Merger Sub and the Company
entered into the Agreement and Plan of Merger dated as of July 20, 2015 (as amended, the “Merger Agreement”). 
 In
connection therewith, Parent and TerraForm Power, LLC, a Delaware limited liability company (“TERP”), entered into the Purchase Agreement, dated as of July 20, 2015 (as amended and restated, the “Purchase
Agreement”), and Parent, TERP and Merger Sub entered into the Interim Agreement, dated as of July 19, 2015 (as amended and restated, the “Interim Agreement”). 

In connection therewith, a newly created wholly-owned subsidiary of Parent (the “Borrower”), Goldman Sachs Bank USA, Barclays
Bank PLC, Citigroup Global Markets Inc., and UBS Securities LLC will enter into a senior secured term loan facility in the amount of three hundred million dollars ($300,000,000) (the “Term Facility”). 

In connection with the Term Facility, the Borrower and TERP will enter into a take/pay agreement (the “Take/Pay Agreement”)
obligating TERP to purchase from the Borrower and its subsidiaries, the “cash” or “sponsor” equity positions in equity partnerships or funds arranged by the Borrower for residential solar systems (the “Solar Residential
Systems”). 
 In connection with the transactions contemplated by the Merger Agreement, the Purchase Agreement, the Interim Agreement,
the Term Facility, and the Take/Pay Agreement, and for other good and valuable consideration, the receipt and sufficiency of which is hereby acknowledged and accepted, Parent and TERP hereby agree as follows: 

 

	1.	 Notwithstanding anything to the contrary contained in the Take/Pay Agreement or the Purchase Agreement, Parent shall, and shall cause its affiliates
(excluding TerraForm Power, Inc. and its subsidiaries) to, use reasonable best efforts to sell (a) Solar 










	 	
Residential Systems while the Take/Pay Agreement remains in effect and (b) prior to, at or immediately after the Closing (as defined in the Purchase Agreement), the Purchased Subsidiaries
(as defined in the Purchase Agreement) that TERP would otherwise be obligated to purchase under the Take/Pay Agreement and the Purchase Agreement, respectively, to a third-party purchaser or purchasers (excluding TerraForm Power, Inc. and its
subsidiaries); provided, however, that Parent shall not, and Parent shall not cause or permit its affiliates (including the Borrower, but excluding TerraForm Power, Inc. and its subsidiaries) to, enter into any agreement with respect
to the sale of any such Solar Residential Systems or any such Purchased Subsidiaries or consummate any such sale if the Solar Residential Systems or the Purchased Subsidiaries being sold in such transaction consist of 100 or more megawatts (DC), in
each case, without the prior consent of the Corporate Governance and Conflicts Committee of the Board of Directors of TerraForm Power, Inc. (the “Committee”). 


 

	2.	Parent shall (a) keep the Committee (and, solely insofar as it relates to the Purchased Subsidiaries, the Company) promptly informed on a current basis as to the status of its efforts and activities to sell the
Solar Residential Systems and the Purchased Subsidiaries that TERP would otherwise be obligated to purchase under the Take/Pay Agreement and the Purchase Agreement, respectively, to a third-party purchaser or purchasers (excluding TerraForm Power,
Inc. and its subsidiaries) in accordance with Section 1 hereof and of any material decisions, changes or developments in connection therewith, including, but not limited to monthly updates of any syndications of asset-backed securities committed
warehouse line of credit facilities (in the case of the Solar Residential Systems), and (b) consult with the Committee (and, solely insofar as it relates to the Purchased Subsidiaries, the Company) in connection with such efforts, activities,
decisions, changes and developments and shall consider in good faith the Committee’s reasonable input and suggestions with respect thereto. Without limiting the generality of the foregoing, Parent shall promptly notify the Committee (and,
solely insofar as it relates to the Purchased Subsidiaries, the Company) of the material terms and conditions of any offer, inquiry or proposal that Parent, the Company, the Borrower or any of their respective affiliates receives from any third
party in respect of the sale or potential sale of the Solar Residential Systems and the Purchased Subsidiaries, pursuant to Section 1, which notice shall include the identity of the third party or parties that have made any such offer, inquiry
or proposal, and Parent shall as promptly as practicable provide to the Committee upon request copies of all documentation and correspondence relating thereto. 

  

	3.	 Notwithstanding anything to the contrary contained in the Purchase Agreement, if (a) Parent, the Company or any of its subsidiaries enters into one or
more purchase and sale agreements or other similar agreements (each such agreement, an “Alternative Sale Agreement”) to sell one or more Purchased Subsidiaries (each such Purchased Subsidiary, an “Alternative Sale Purchased
Subsidiary”) to a third-party purchaser or purchasers other than TerraForm Power, Inc. or any of its subsidiaries between the date hereof and the Closing (as defined in the Merger Agreement, the “Merger Closing”) and (b)
the Merger Closing occurs (including that Parent has wired to the Paying Agent under the Merger Agreement the full cash portion of the Merger Consideration and has available cash funds to pay its other obligations in connection with the Merger),
then (1) TERP shall be automatically relieved of all of its obligation under the Purchase Agreement to purchase the Purchased Interests (as defined in the Purchase Agreement) of each Alternative Sale Purchased Subsidiary, (2) each such Alternative
Sale Purchased Subsidiary shall automatically no longer be a Purchased Subsidiary for any purpose under the Purchase Agreement and (3) no Purchase Price (as defined in the Purchase Agreement) shall be owed or paid by TERP to Parent at the Closing
(as defined in the Purchase Agreement) in respect of such Alternative Sale Purchased Subsidiaries, in each case of clauses (1), (2) and (3), without any further action being required by any entity or person. If Parent, the Company or any of its
subsidiaries enters into an Alternative Sale Agreement, Parent shall ensure that such Alternative Sale Agreement will not limit TERP’s ability or obligation to purchase the Purchased Subsidiaries at a time that TERP is required to make such
purchase pursuant to the terms of the Purchase Agreement. 










	4.	Parent and TERP acknowledge and agree that, to the extent Parent, the Company or any of its subsidiaries sells any Purchased Subsidiary to any third-party purchaser or purchasers in accordance with Section 1
and the purchase price in such transaction is less than the portion of the Purchase Price that would otherwise be payable by TERP under the Purchase Agreement in respect of such Purchased Subsidiary, neither TerraForm Power, Inc, TERP nor any of
their respective subsidiaries shall have any obligation to pay or reimburse the amount of such difference in price to Parent, the Company or any of its subsidiaries and such difference in price shall be entirely for the account of Parent.


  

	5.	Parent shall use its reasonable best efforts to manage or cause the management of the Borrower in accordance with prudent industry practices and in a cost efficient manner in order to cause the repayment in full of the
Term Facility by December 31, 2016. 

  

	6.	In accordance with the Commitment Letter for the Term Facility, the Parent will make a $100 million Equity Contribution (as defined in Annex C of the Commitment Letter) to the Borrower concurrent with the closing of the
Term Facility. 

  

	7.	On December 31, 2016, Parent shall, or shall cause the Borrower to, repay the Term Facility in an amount equal to the lesser of (a) $25,000,000 and (b) the amount of outstanding principal and accrued and
unpaid interest under the Term Facility as of December 31, 2016. 

  

	8.	Parent shall include on the agenda for the next full meeting of its Board of Directors scheduled for January 2016 a review by the directors of the minimum quarterly distribution tiering on Incentive Distribution Rights
with TerraForm Power, Inc. and its applicable subsidiaries. 

  

	9.	Each party to this letter agreement hereby represents and warrants to the other parties as follows: (a) such party has the requisite corporate or other legal entity power and authority to execute and deliver this
letter agreement; (b) the execution and delivery of this letter agreement by such party has been duly and validly authorized by all necessary corporate or other legal entity action, and no other corporate or other legal entity proceedings on
the part of such party are necessary to authorize this letter agreement; and (c) this letter agreement has been duly executed and delivered by such party and, assuming the due authorization, execution and delivery by such other parties,
constitutes a legal, valid and binding obligation of such party, enforceable against such party in accordance with its terms, except as such enforceability may be limited by bankruptcy, insolvency, reorganization, preference, fraudulent transfer,
moratorium or other similar laws relating to or affecting the rights and remedies of creditors and by general principles of equity. This letter agreement and any obligations of the undersigned parties shall be binding upon the successors, assigns,
heirs or personal representatives of each of the undersigned parties. 

  

	10.	This letter agreement and any claim, controversy or dispute arising under or related to this letter agreement shall be governed by and construed in accordance with the laws of the State of Delaware, without regard to
the conflict of laws principles thereof. 

  

	11.	 This letter agreement shall not modify the terms of the Merger Agreement or the Interim Agreement in any way, and the Merger Agreement and the Interim
Agreement shall remain in full force and effect in accordance with its terms. This letter agreement 










	 	
shall not modify the terms of the Take/Pay Agreement once it is entered into, and neither TERP nor any of its subsidiaries shall be relieved of, or have any right of setoff in respect of or
defense, counterclaim or other legal or equitable discharge of, any of its obligations arising out of the Take/Pay Agreement by virtue of this letter agreement or any claims it may have against Parent or any of its affiliates (including, without
limitation, the Borrower) hereunder. This letter agreement may be executed in multiple counterparts and transmitted by facsimile or by electronic mail in “portable document format” (“PDF”) form, or by any other electronic
means intended to preserve the original graphic and pictorial appearance of a party’s signature. Each such counterpart and facsimile or PDF signature shall constitute an original and all of which together shall constitute one and the same
agreement. 

  

	12.	Each of Parent and TERP expressly agree that any breach or failure to perform by Parent of its obligations or agreements under this letter agreement shall not constitute a breach or failure to perform by Parent of its
obligations or agreements under the Purchase Agreement, the Interim Agreement or the Take/Pay Agreement or otherwise constitute a failure of any condition to be satisfied under the Purchase Agreement, the Interim Agreement or the Take/Pay Agreement.


  

	13.	The parties hereto may extend, waive, amend, supplement, terminate or otherwise modify any term of this letter agreement by mutual agreement; provided, however, that any such extension, waiver, amendment, supplement,
termination or other modification to this letter agreement at any time prior to Closing (as defined in the Purchase Agreement) (1) to the terms of Section 2, 3, 12, 13 or 14 or (2) that would otherwise be materially adverse to the interests of the
Company, in each case, shall be subject to the prior written consent of the Company (which consent shall not be unreasonably withheld, conditioned or delayed). For the avoidance of doubt, notwithstanding anything to the contrary herein, nothing in
this letter shall create any privity of contract between the Company and TERP. 

  

	14.	Nothing in this letter agreement is intended to confer, and does not confer, on any person or entity, other than Parent and TERP, any legal or equitable right, remedy or claim, except that the provisions of Sections 2,
3, 12, 13 and 14 of this letter agreement shall be enforceable by the Company against the Parent. 

  

	15.	Nothing in this letter agreement represents or shall be deemed for any purpose to represent a complete statement of any party’s rights and nothing contained herein constitutes or shall be deemed for any purpose to
constitute an express or implied waiver of any rights, claims, counterclaims, defenses or remedies in connection with the transactions contemplated by the Merger Agreement, the Purchase Agreement, the Interim Agreement or this letter agreement, all
of which are expressly reserved. 

 [Remainder of Page has Intentionally Been Left Blank; Signature Page
Follows] 








					
	SUNEDISON, INC.
		
	By:	 	 /s/ Ahmad Chatila

		 	Name:	 	Ahmad Chatila
		 	Title:	 	President and Chief Executive Officer
	
	ACKNOWLEDGED AND AGREED:
	
	TERRAFORM POWER, LLC
		
	By:	 	 /s/ Brian Wuebbels

		 	Name:	 	Brian Wuebbels
		 	Title:	 	Chief Executive Officer