Google Inc. is making its largest bet yet on renewable energy, a $300 million investment to support at least 25,000 SolarCity Corp. rooftop power plants.