The first time I turned it on, it burnt out the relay - what am I missing?
The code works (i think) - essentially, when the input from the light sensor on pin 2 is HIGH and then pin 5's output is set to HIGH, turning the solenoid on.
There was smoke, and the smell of burning plastic.
i've since modified to the above circuit and a new relay, but now the solenoid does not get enough current. it still works when hooked directly up to the powersupply
It might be taking in flyback voltage from the coil of the solenoid and hurting your relay; crazy it got this severe unless something isn't quite hooked up right somewhere but the schematic you drew looks right. Only thing I can mention is that relay should have a "catch diode" on it where cathode is up at the +V side of the relay and shorts over to the low side of the coil. Search "relay flyback diode" and there's a ton of stuff there on this and how high the voltage spike can be without that.
Do you have a link to the solenoid? Solenoids are rated for continuous duty or intermittent duty, what exactly do you have. Already mentioned is need for a flyback diode across your solenoid coil. The same is true for relay coils.