Preheat the oven to 375°F (190°C). Wash the potatoes, wrap each tightly in foil, and place them on a baking sheet or stone; bake until very tender, about 90 minutes. Remove and cool until warm enough to handle.
Peel the warm potatoes and press them through a ricer onto a clean work surface, or mash gently until smooth with a masher; avoid overworking to keep the texture light.
Add the ricotta to the riced potatoes and gently fold until lightly distributed. Sprinkle the flour and a pinch of salt over the potatoes and fold to combine without smashing.
Make a well in the center and add the lightly beaten egg and the remaining 1/4 teaspoon salt; gently work the egg into the mixture to form a soft, smooth dough being careful not to overwork it.
Divide the dough into 4 pieces. On a lightly floured surface, roll each piece into a log about ¾ inch in diameter. Cut the logs into ½–¾ inch pieces using a floured knife or bench scraper.
Shape each piece by pressing gently with your finger or rolling it down the back of a fork to create ridges, if desired. Lightly flour shaped gnocchi to prevent sticking.
Bring a large pot of salted water to a boil. Reduce heat slightly to maintain a gentle boil and cook the gnocchi in batches so they don’t crowd; they are done when they float, about 2 minutes.
Use a slotted spoon to transfer the cooked gnocchi to a clean, dry baking sheet while you cook the remaining batches so they can dry briefly.
Serve the gnocchi immediately with warmed marinara sauce, freshly grated Parmesan, and torn basil.