In a large skillet heat cook the onion in the olive oil until tender. Add the spaghetti sauce, black beans, kidney beans, corn, and mix well. Stir in the cumin, red pepper sauce, salt, and ground black pepper. Simmer for 15 to 20 minutes.
Meanwhile, in a large pot with boiling salted water cook spaghetti until al dente. Drain.
Toss pasta with spaghetti sauce. Serve with freshly grated Parmesan cheese.