Use a MOSFET, as in this circuit (ignore the stuff about PWM):
http://ruggedcircuits.com/html/circuit__7.html
Replace 12V with 24V in the circuit. The MOSFET is any general-purpose LOGIC-LEVEL MOSFET (that's important!) that can handle 24V and whatever current your relay needs. Similarly, the diode is any general purpose diode.
--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons