In a bid to establish itself as a clean energy giant, Tesla Motors has offered to buy SolarCity, one of the largest makers of solar panels for residential and commercial use.