Coal's share of electricity generation has been falling, largely because of competition with natural gas.