Bring a pan of lightly salted water to the boil. Add the spaghetti and stir from time to time. Cook for approx.10 minutes, following the packet instructions.
Meanwhile, cut the courgette into thin rings, brush them with some oil and griddle or grill for 2-3 minutes each side, until lightly charred.
Heat the remaining oil in a small pan and add the garlic and chilli flakes, if used. Stir for a few seconds, don’t let it burn, then add the ricotta and a ladleful of the cooking water. Stir, then add the lemon juice and zest. Cook for a minute.
When the spaghetti is cooked (it should be al dente) take a cup of the water and set aside, then drain the pasta.
Mix the spaghetti with the ricotta, adding a little more pasta water, if necessary. The sauce should be creamy, not too wet.
Fold in gently the rocket leaves, add the grilled courgette, then season with salt and pepper.
Serve immediately.