Preheat the oven to 375°F (190°C). Wash the potatoes and wrap each tightly in foil; place on a baking sheet or stone and bake until very tender, about 90 minutes. Remove from the oven, unwrap, and cool until they can be handled but are still warm.
Peel the warm potatoes and press them through a ricer onto a clean work surface, or mash gently until smooth and free of lumps.
Make a mound of the riced potatoes and add the ricotta; gently fold to distribute. Sprinkle the flour and 1/4 teaspoon salt over the potatoes and fold briefly to combine without overworking.
Make a well in the center and add the lightly beaten egg. Gently work the egg into the potato mixture until a soft, smooth dough forms; do not overmix or the gnocchi will become dense.
Cut the dough into 4 pieces. On a lightly floured surface, roll each piece into a log about 3/4-inch (2 cm) in diameter. Using a floured knife or scraper, cut the logs into 1/2- to 3/4-inch pieces.
Shape each piece by pressing gently in the center with your finger or rolling it over the back of a fork to form ridges, if desired. Lightly dust with flour to prevent sticking.
Bring a large pot of salted water to a boil. Reduce heat slightly so the water stays at a gentle boil. Cook the gnocchi in batches to avoid crowding; they are done when they float, about 2 minutes.
Use a slotted spoon to transfer the cooked gnocchi to a dry baking sheet to rest while you cook remaining batches.
To serve, warm marinara sauce, add the gnocchi, and sprinkle with Parmesan and fresh basil. Serve immediately.