When the output is turned off there is basicly no connection there, the cap charges to 24 volts with the negative end facing the output and the positive end facing the coil. Then think of it as a battery in this polarity. Then the output turns on, think of this as another battery referenced to the common of the coil. The output is +24 volts connected to the negative end of the cap (battery) and the +24 volts of the cap is in series with the 24 volts of the supply. At the time the output turns on there is +48 volts on the coil. After the capacitor discharges (battery goes dead) there is +24 volts on the coil, supplied thru the diode,(minus the diode turn on voltage 0.7v). For this to work the recycle-off time of the solenoid would have to be longer than the recharge time of the cap. Also, during the time the output is on there would be 48 volts across the resistor, so the resistance would have to be high enough to prevent excessive current there.