How to get the full Vcc output from comparator?
Don't connect the solenoid to ground, connect it to Vcc and use the MOSFET with its source tied to ground - drain to the other end of the solenoid. Put the protection diode across the solenoid, cathode to Vcc.

Now, if you do this you'll most likely find that it behaves much more as you would expect it to because the MOSFET will turn on properly. You need to maximize gate-source voltage from the Vcc rail to turn it on properly. What you had before was called a source follower and with your solenoid voltage required and your limited 9V supply it would never turn on effectively. Here's a snapshot of the changes: -







simulate this circuit &ndash; Schematic created using CircuitLab