A worker cleans the panels in a solar power park run by the Costa Rican Electricity Institute (ICE) as the power company has managed to produce all of the electricity for the nation from renewable energy sources for more than 80 days straight on March 26, 2015 in Guanacaste, Costa Rica.

Japan is now one of the world's four largest markets for solar panels and a large number of power plants are coming onstream, including two giant arrays over water in Kato City and a $1.1 billion solar farm being built on a salt field in Okayama, both west of Osaka.

Solar power is set to become profitable in Japan as early as this quarter, according to the Japan Renewable Energy Foundation (JREF), freeing it from the need for government subsidies and making it the last of the G7 economies where the technology has become economically viable.

One by one, Japan is turning off the lights at the giant oil-fired power plants that propelled it to the ranks of the world's top industrialized nations. With nuclear power in the doldrums after the Fukushima disaster, it's solar energy that is becoming the alternative.

"Solar has come of age in Japan and from now on will be replacing imported imported uranium and fossil fuels," said Tomas Kåberger, executive board chairman of JREF.

"In trying to protect their fossil fuel and nuclear (plants), Japan's electric power companies can only delay developments here," he said, referring to the 10 regional monopolies that have dominated electricity production since the 1950s.

Japan is retiring nearly 2.4 gigawatts of expensive and polluting oil-fired energy plants by March next year and switching to alternative fuels. Japan's 43 nuclear reactors have been closed in the wake of the 2011 meltdown at the Fukushima power plant after an earthquake and a tsunami - since then, renewable energy capacity has tripled to 25 gigawatts, with solar accounting for more than 80 percent of that.

Read MoreHow sanctions are hurting Russia's energy sector

Once Japan reaches cost-revenue parity in solar energy, it will mean the technology is commercially viable in all G7 countries and 14 of the G20 economies, according to data from governments, industry and consumer groups.

A crash in the prices of photovoltaic panels and improved technology that harnesses more power from the sun has placed solar on the cusp of a global boom, analysts say, who compare its rise to shale oil.

"Just as shale extraction reconfigured oil and gas, no other technology is closer to transforming power markets than distributed and utility scale solar," said consultancy Wood Mackenzie, which has a focus on the oil and gas industry.

Oil major Exxon Mobil says that "solar capacity is expected to grow by more than 20 times from 2010 to 2040."

Investors are also re-discovering solar, with the global solar index up 40 percent this year, lifting it out of a slump following the 2008/2009 financial crisis, far outperforming struggling commodities such as iron ore, natural gas, copper or coal.

Cheaper panels

By starting mass-production of solar panels, China is the driving force in bringing down solar manufacturing costs by 80 percent in the last decade, according to Germany's Fraunhofer Institute.

In Japan, residential solar power production costs have more than halved, since 2010 to under 30 yen ($0.25) per kilowatt-hour (kWh), making it comparable to average household electricity prices.

Read MoreCramer's epic Earth Day green energy plays

Wood Mackenzie expects solar costs to fall more as "efficiencies are nowhere near their theoretical maximums."

Solar is already well-entrenched in Europe and North America, but it is the expected boom in Asia that is lifting it out from its niche.

China's new anti-pollution policies are making the big difference. Because of these policies, Beijing is seeking alternatives for coal, which makes up almost two-thirds of its energy consumption.

China's 2014 solar capacity was 26.52 gigawatt (GW), less than 2 percent of its total capacity of 1,360 GW.

But the government wants to add 17.8 GW of solar power this year and added 5 GW in the first quarter alone, with plans to to boost capacity to 100 GW by 2020.

Coal-dominated India, with its plentiful sunlight, could also take to solar in a big way.

Despite this boom, fossil-fuelled power is far from dead.

"Additional generating capacity, such as natural gas-fired plants, must be made available to back up wind and solar during the times when the sun is not shining and the wind is not blowing," Exxon says.