At the moment when so many industries are staggered by the coronavirus pandemic, investors are beating the market by putting their money in companies committed to environmental, social and governance priorities favoring transparency, diversity and sustainability.

ESG is where profits are, signaling that doing the right thing increasingly is the smartest bet. The iShares exchange-traded fund investing in companies it thinks have “positive environmental, social and governance characteristics,” one of the largest of the type, produced a total return this year that is more than three times the performance of S&P 500 index.

The convergence of high-mindedness and profit was noted this month by Al Gore, the former vice president, 2000 Democratic presidential candidate and Oscar-winning environmental documentarian. He told a Bloomberg conference, “It is ever clearer that sustainable technologies are cheaper and better.”

For more and more companies, doing the right thing is becoming as much a business imperative as a social responsibility, especially in the market for renewable energy. Apple Inc., the Cupertino, California maker of personal computing and mobile communication devices that has appreciated 30% this year, recently unveiled its plan to become carbon neutral across its entire manufacturing supply chain and product life cycle by 2030. Nike Inc., the Beaverton, Oregon designer and manufacturer of athletic shoes and apparel, is part of the RE100 coalition of companies planning to supply all energy needs from renewable sources by 2025.

“Long term, renewables could emerge stronger than ever, especially if governments integrate support for clean energy into Covid-19 economic-recovery programs,” said a report in May by the Yale School of Environment.

That’s already reflected in the anticipated performance of 38 U.S.-based companies generating at least 50% of their revenue from clean-energy products or clean technology. As a group, their sales are expected to rise 9% this year, 30% in 2021 and 23% in 2022, according to data compiled by Bloomberg.