Heat the olive oil in a large frying pan set over medium heat.
Add onions and cook, stirring occasionally, until soft, about 5 minutes.
Add mushrooms, garlic, thyme, salt and pepper and cook, stirring frequently, until mushrooms are very tender, about 10 minutes.
Add tomatoes and juices and cook until the mixture starts to thicken, about 10 minutes.
Stir in beans and cook until beans are warmed through, about 10 minutes.
Serve over brown rice or polenta.
The ragout can be made up to 2 days in advance. Store, covered, in the refrigerator. Reheat before serving.