To make the sauce, begin by softening the onion in the olive oil, in a wide deep saucepan until tender and translucent. Now add the garlic, thyme and coriander and stir about for a few seconds. Pour in the red wine, and let it bubble up until almost all boiled away.
Tip in the tinned tomatoes, the tomato puree, caster sugar, salt and pepper. Bring up to the boil, then leave to simmer down until good and thick, stirring occasionally. This should take about 40-60 minutes. Meanwhile, rinse the spinach thoroughly, drain and pat dry with clean kitchen towels. Stir the spinach and basil into the sauce as soon as it is done, while it is still extremely hot. Taste and adjust the seasoning.
Cook the lentils in a large pan of boiling unsalted water until just tender, but still firm enough to hold their shape – around 15-20 minutes. Drain well, then stir into the tomato and spinach sauce.
Pour this mixture into a shallow ovenproof gratin dish (I use one that is 21 cm x 34 cm (8 1/2” x 13 1/2”). Scoop out dessertspoons of the ricotta and dot them over the surface of the gratin, pushing them down gently into the sauce. Mix the breadcrumbs with the Parmesan and sprinkle evenly over the top. Drizzle with olive oil.
Pre-heat the oven to 200C. Bake the gratin for about 25-30 minutes, until sizzling and deliciously patched with brown.