Scrub the beet or beets and put in a large pot. Cover with water by 1 to 2 inches.
Boil until tender enough to slide a knife into the center with ease (about 45 minutes). If the water drops below the beet(s), add more and bring to a boil again. Once tender, drain and set aside until cool enough to handle.
Cook the pasta in a large pot of lightly salted boiling water until al dente. Scoop up 1 cup of pasta cooking water and set aside. Drain remaining water.
While the pasta cooks, remove the skin from the beets. Cut into quarters and put in a blender.
Add ΒΌ cup reserved pasta cooking water to the blender along with the ricotta, olive oil, lemon juice, and 1 teaspoon salt and run until smooth.
Transfer the pasta to a serving bowl or platter. Pour the sauce over the top and toss to coat well.
Sprinkle the walnuts or slivered almonds over the pasta. If desired, garnish with grated Parmesan cheese and basil. Serve immediately.