Under a federal law called the Public Utility Regulatory Policies Act (PURPA)

Utilities must allow homes that produce their own energy to connect to the energy grid; the companies must buy any excess power homes or businesses produce. Many states have gone past that to allow net metering, which is a solar incentive that allows you to send energy back to the grid and get credit for it on your utility bill. If the PV system uses net metering, the utility’s electricity meter runs backwards when power is exported from the PV system to the utility.