For the sauce, heat the olive oil in a wide, deep saucepan, over a low heat. Add the onion and soften until tender and translucent - about 5 minutes.

Add the garlic, thyme and coriander to the pan, while still on the heat. Stir for a few seconds, before pouring in the red wine. Cook down over a moderate heat, until almost all the wine has evaporated.

Tip in the tinned tomatoes, and add the tomato puree, caster sugar, salt and pepper. Bring to a boil, and turn down the heat. Simmer for 40-60 minutes, until thickened and rich-looking. Stir the spinach and basil into the sauce, and season to taste.

While the sauce is simmering, cook the lentils in a large pan of boiling unsalted water until just tender, though still holding their shape - about 15-20 minutes. Drain in a colander and stir the lentils into the tomato and spinach sauce.

Pre-heat the oven to 200C/gas 6. Pour the gratin mixture into a shallow ovenproof gratin dish (21cm x 34cm) or shallow casserole pan. Scoop out tablespoons of ricotta cheese and dot 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 the gratin with olive oil before baking.

Bake the gratin for about 25-30 minutes, until sizzling and golden. Serve straight away.