Applying AC to a DC relay coil
Add a bridge rectifier and it should work OK.







simulate this circuit &ndash; Schematic created using CircuitLab

You can use four diodes or a bridge rectifier which may be neater.

[Update after comments]

Capacitor is not required.
Provided no smoothing capacitor is added the rectified 24 V AC will be have wave rectified 24 V RMS (ignoring diode losses). The heating effect in the coil of 24 V RMS is exactly the same as 24 V DC so no problem there.

Addition of a capacitor will result in slow drop-out and slow opening of the contacts. If the load is significant relative to the contact rating then arcing and premature failure will occur. 

Addition of a capacitor will also result in higher DC voltage - approaching DC peak - and this will overheat the coil. Half-wave rectification requires addition of a capacitor which is a bad idea as discussed above.

Relay chatter isn't a problem because 


The coil inductance tends to keep the current flowing to some extent.
The inertia of the armature keeps everything in position.
Maybe a little residual magnetism in the armature circuit helps a little too. Note that DC relays usually have a little stop pin or 'bump' to prevent them making a really good closed loop magnetic circuit - otherwise residual magnetism might be enough to hold the relay closed when power is removed.


Reverse diodes to protect the bridge rectifier aren't required as the function is provided by the bridge itself.