Saving spoiling mushrooms?
It depends what you mean by "on their way out". If they are just starting to develop a slimy sheen, cook them as soon as possible - much more than that and you'll want to throw them away.

In this state they should be OK to slice into sauces like bolognese.

You could cut them into a very fine dice and gently fry in butter. The resulting delicious black mush is a good omelette filling, or you can refrigerate/freeze it to use later as an umami additive for sauces.