Put the basil, garlic and pinenuts into a food processor and pulse until you have a very rough pesto. Scrape into a bowl and add the Parmesan and enough oil to bring all of the ingredients together. Set aside.
Add salt to the boiling water and cook the green beans in the salted water for 2 minutes.
Add the pasta and cook for a further 2 minutes.
Drain and stir through the pesto.
Divide between bowls and serve with a scoop of ricotta and a squeeze of lemon juice.