Solar panels, or photovoltaic panels, are designed to collect sunlight and turn it into energy. They don't rely on the power grid to work. If there's a power outage, solar panels will continue to work. Whether you can harness the energy they are producing, and how much of that energy you can use, will depend on the type of system you have installed.
Basics of Solar Energy
According to Get Solar, photovoltaic panels are usually made of silicon in a metallic frame. When sunlight hits this silicon, it absorbs photons, the sunlight's energy. This creates free-roaming electrons, which are attracted to the inlaid metal, charging it with electricity. This is known as a direct current, or DC. However, most of the appliances and applications in your home use alternating current, or AC. At this point, you can either use an inverter to convert your energy to AC for use in your home, or send it directly to the power grid as DC.
Get Solar estimates that most homes use this a grid-connected photovoltaic system, which has no batteries. This system sends as much power as you need through the inverter for use in your home. The excess energy goes back to the power grid. This means that you have a steady supply of power during the day when the solar panels are collecting electricity, but at night you're dependent on the grid. In a power outage, therefore, you would have electricity during the day but not at night. Your electricity would also be limited to the amount of power your solar array can produce.
Systems With Battery Storage
The U.S. Department of Energy recommends using a battery system to supply electricity in areas where power is unavailable. This type of system stores excess energy in a battery. The battery charges during the day, making power available to you at night. These systems are designed to stand on their own: in a power outage, you would still have electricity through the day and night, though you would be limited by the capacity of your battery. Get Solar writes that most homes don't have battery storage, saying that "It's so expensive it just isn't practical unless you live in the middle of nowhere."
Stand-alone photovoltaic systems do not use batteries and are not connected to a grid, but they will still produce power during an outage. These systems are connected directly to DC-powered systems, usually water pumps, fans and other DC-specific appliances. According to the Department of Energy, the advantage of such systems is that they supply power when and where it's needed, usually by running machinery during the daytime. A stand-alone system will work smoothly whether the grid is up or down, and is cheaper and simpler than either of the systems described above; however, it won't produce any energy at night.
The U.S. Department of Energy details other uses of solar panels, particularly in a system that uses a combination of grid power and a generator. In remote locations, this can supply steady electricity even though the power grid is completely unavailable. This type of system can work for medical clinics and hospitals, or any situation where power needs and use are unreliable.