I've been playing around with solenoids and relays this weekend. Here's a relay I got from Surplus Gizmos being controlled by an Arduino.
I used the circuit here. It's a bit strange having 120 volts of AC so close to my USB port. ;) I used a TIP102 transistor and a 1N4004G-T diode, and a relay. The relay is an inductor. Inductors (like solenoids and motors) accomplish work by generating a magnetic field. So for a motor you generate a field and it spins, but when you stop generating the field the motor doesn't stop immediately (it's got momentum). At that point, the motor is generating electricity and trying to feed it back into your circuit. The diode is there to deal with this, it's called a "snubber diode". The datasheet for the relay mentions an internal snubber circuit and it only takes 5v to trigger so I *think* I could have hooked the AVR up directly to the relay. I vaguely remember Don going over this during the motors class he put on.
The circuit for triggering a solenoid is similar, but my battery for the solenoid was dead so it wasn't that impressive to look at. There's some good solenoid info in Episode 12 of Fat Man and Circuit Girl at around the 70 minute mark (yes that right, minutes! heh) and also the Physical Computing book had the schematic I ended up understanding and using to trigger the solenoid.