Where does the electricity, generated by a solar panel, go if you don't use the electricity? I'm sorry if this question is too trivial for this Q&A forum. I am a layman when it comes to physics (though I did cover the high-school physics courses).
I was wondering what happens to the electricity, that is generated by your own solar panel, in case you don't use any electricity in your home. Does it turn from electrical energy into heat? Or does something else happen? Is the energy "lost" for practical purposes? 
A follow-up question: In case the energy is "lost" for practical purposes, wouldn't that be an enormous waste of energy? Is this what the "Smart Grid" network is intended for? To distribute the energy to other places where it is needed, thereby minimizing the energy loss and CO_2 emissions? 
 A: There are several ways to design the circuit.
If it's a Smart system, then when there's surplus power, additional devices will get turned on, to use it: dishwashers, washing machines, or immersion heaters in hot-water storage tanks. If there's still surplus after that, then it's as below.
If it's grid-connected, with an inverter, then it's usually designed to export surplus power to the grid. There's typically either an export meter, or the property's main electricity meter runs backwards during those times, to ensure that payment is made for the exports.
If it's designed as standalone, then it might have a battery where surplus power is initially sent. When the battery's full, then it's as below.
In the absence of other uses of the surplus, there's a resistance heater and heat sink where the generated power is dumped.
And in general, the economics tends to ensure that enormous amounts of energy are not wasted. If there's going to be a large surplus, that will be enough to justify expenditure on one or more of: a Smart system, a grid export connection, local storage.
A: Hmm, I think it would depend on the panel circuit.  If the panel is not connected, for example, the charge potential would still be created at the leads, but since it's not being drained into a storage device (or otherwise used), the solar medium would saturate at some measurable voltage boundary.  Whether it turns to heat at that point depends on whether the solar medium leaks the charge (variant on light intensity) or the other possibility is that the solar cell's reflectivity changes and the sunlight no longer gets absorbed (not the case in any solar technology that I've heard of).
In general, to have heat (in/from a solar panel), you have to have current flow.  That flow can happen from leaky charges (at the battery bank or the solar panel itself) or intentional due to your own usage with the inefficiencies in your electrical equipment.
As far as wasted energy, it's been vegetation that has trapped this solar energy in earth's history, creating biomass -- ancient sunlight which we now use in the form of coal and oil.  Consider that the energy lost cannot be greater than the amount of sunlight now denied in the square footage that lies in the shadows beneath your panels.  
Otherwise, generally, when generated electricity isn't used, it can be sold to the power company.  If that's not an option (because you're off the grid), you should get more storage (batteries, flywheel...)
A: Answering this nine-year-old question because IMO, it deserves a low-level (physics-based) answer, and the others tend toward higher-level (more practical) explanations.
A Photovoltaic cell is a P/N Diode. Light shining on the junction creates a forward bias by separating charges across the junction. If an external circuit provides a lower impedance path for the charge to flow back to the side from which it came, then current will flow through the circuit. If not (e.g., if the cell is not connected to an external circuit at all,) then the charges simply will flow back across the junction in the forward direction.
Charge flowing across the forward biased junction dissipates power in the cell itself. The cell gets warmer in the sunlight if it is disconnected from an external circuit than it would get if something was drawing electric power from it.
A: A common alternative to maintaining your own power storage is net metering, where surplus power is fed onto the grid (and paid for by the electric company), offsetting power drawn from the grid (and paid for by the user) at times when local generation is not sufficient to meet demand. My own solar installation works that way; if a month is particularly sunny I could theoretically have a negative electric bill. Hasn't happened yet but I've come very close.
Note that this requires a meter, and inverters, specifically designed for the purpose; the inverters need to match phase with the grid, and they need to power down when the grid does to protect linemen. But the requisite hardware is widely available and the number of power companies that can handle this setup has increased tremendously over the past decade.
A: I come across this cause I am working on this problem.
I see long talk and they don't know the answer.
Yes, the energy is lost, when all systems are fully charged and outside the sun is still shining. No meter PWM or MPPT charging system. You just cant put more into batteries when its full. Full means full. 
Solution is ultracapcitors. Assemble a capacitor module, for $12v$ solar system, rated $23$ volts $3000$ Farads, if you got money make it $6000$ Farads, and connect it directly to solar panel. No need controllers for this one cause caps handle $23v$ and $12v$ solar panel give $17v$ to $22v$. 
I built it, cant wait to buy more caps and attach another cap module to double or triple or more the power. 
Warning, this work only with solar charger controllers that are rated $80A$ that's a minimum. But if you play with small $10F$ caps $7amp$ charger fit. 
Result. When the sun is gone solar charger controller is indicating Charging, cause my ultracapacitors still contain power that is left over for you.
