I have a capacitor rated at 5V, but I have a 9V solar cell that I want to connect to it.
First, I know charging with a voltage above the capacitor rating is bad, but what if I disconnect it when the charge gets to 5V on the capacitor? Or, is there a way to reduce the 9V to 5V and keep no higher than this voltage? The only thing I can think of is 7 diodes in a row (0.7 volt drop across each diode). This seems a little ridiculous.
Do you have another capacitor? You can put them in series which will accept 10V (albeit for half the effective capacitance).
Yes, you could disconnect the 9V source when the voltage reaches 5V, but this sounds relatively complicated.
You could put the 9V through a voltage divider to get no higher than 5V, though this wastes current and slows down capacitor charging (any more details on what you're trying to do?)
You could also put a 4.7V zener diode across the capacitor to limit the voltage. Again, the best solution is going to depend upon what you're actually trying to do.
(1) Solar cells issue their current at quite different voltage, http://www.pvresources.com/en/solarcells.php
Is 9V really the max of your "system"?
(2) The energy stored in a cap goes with V square, thus also the price ;D