The company has made an all-stock deal worth as much as $2.8bn (£1.9bn).
Tesla shares fell 10% in extended trading after the announcement while SolarCity jumped 23%.
California-based Tesla is known as a pioneer in electric cars but since last year has also been selling batteries that can power homes and businesses.
Tesla chief executive Elon Musk described the deal as a "no brainer".
He said it would transform Tesla into the "world's only vertically integrated energy company offering end-to-end clean energy products", from solar panels and home storage batteries to electric vehicles.
Elon Musk is under serious pressure to make Tesla profitable. The path to that goal is two-fold. The cars may eventually bring in serious money, but the outlay needed to fund the manufacture of the vehicles is far greater than what sales are bringing in.
But while Tesla is considered to be a carmaker first and foremost, the real money might be in selling energy technology. Its enormous Gigafactory, opening this summer, will be able to make batteries for much more than cars.
The SolarCity purchase was always on the cards. Musk is already the firm's chairman and biggest shareholder, and the company's chief executive, Lyndon Rive, is Musk's cousin.
Some are questioning why Tesla had to buy SolarCity rather than just work closely with it. SolarCity has struggled lately, and so some are calling this a Tesla-financed bailout.

The Mesh Oversight Group report also said complications caused by the implants should be recorded so that experts fully understood the risks.
Vaginal mesh implants are used to treat stress urinary incontinence and pelvic organ prolapse.
But some women said they left them in permanent pain and unable to walk.
The research - seen exclusively by the BBC's Victoria Derbyshire programme - aims to address concerns over the use of mesh devices.
What's the issue with mesh implants?
Mesh implants 'as dangerous as asbestos'
Faulty implants end women's sex life
Prof Keith Willett, who wrote the foreword to the report, said it contained three key recommendations:
The report says: "Adverse events involving mesh as a medical device must be reported and clinicians must bear this responsibility."
It also says surgeons undertaking surgery for stress urinary incontinence "must be able to demonstrate they are performing these operations regularly".
It says that where a mesh is being used to treat pelvic organ prolapse "this should not be offered routinely for the first surgical intervention".
The plastic meshes are made of polypropylene - a material also used to make certain drinks bottles - and are manufactured by many different companies.
They are used to ease incontinence and to support organs such as the vagina, uterus, bowel, bladder or urethra which have prolapsed after childbirth.
The  MHRA says, for the majority of women, the use of vaginal mesh implants is safe and effective.
But some can cut into the vagina, causing severe discomfort.
Currently in the UK, there are around 100 types of vaginal mesh implants.
US electric carmaker Tesla has offered to buy solar panel company SolarCity in a bid to expand its clean energy business.
[NEXT_CONCEPT]
An NHS England report on vaginal mesh implants has recommended better support and communication between patients and doctors over the devices.