The best solution that I have found after failing to put out an engine fire in a stranger's car with a standard fire extinguisher which didn't seem to want to operate very well on it's side or inverted, is to get an extinguisher with an attached flexible hose. That way, you could hold the extinguisher upright and bend the hose to where you needed to put it - either through a popped, but not opened hood, or from underneath the car, spraying upwards into the engine compartment.
_________________________
AJ