Warren Buffett's MidAmerican Energy Holdings Co. agreed to spend as much as $2.5 billion to build two solar projects in California that are set to be the world's largest photovoltaic development.