I'd probably use a bipolar transistor rather than MOSFET, as this will give simpler drive and faster switching.
Can you use inverse PWM (0% = max, 100% = off), or does the PLC have the option to invert the output?
The simplest way to retain a positive switched feed to the solenoid (to keep it failsafe) is a PNP power transistor.
Emitter to positive supply, base to PLC output via a resistor, and add a base-emitter resistor to ensure the transistor switches fully off.
A TIP32, MJE15029 or MJE15033 etc. should be suitable.
The base current should be about 75 - 100mA, so eg. 270 Ohm 3W or 5W resistor from the PLC output to base, then a 1K or 470 Ohm between base & emitter.
If the solenoid valve does not have some form of internal snubber, you will need to add one.
A flywheel diode will prevent back EMF from causing damage, but will also retain the circulating current and may make it appear the output is higher than it is.
You can add a resistor in series with the flywheel diode, about equal to the solenoid resistance, to give faster current delay while limiting the negative spike to around 24V.
[Note for others - in any automation system, control outputs should always be positive-switched for safety; in case of wiring damage, the commonest type of short (to ground, the machine metalwork) switches things off and blows fuses, rather than activating valves or relays etc. which could cause malfunction or injury.]