In a large pot of boiling salted water, cook the spaghetti until al dente. Drain the pasta, reserving 3/4 cup of the cooking water. Add the spaghetti and the reserved pasta cooking water to the skillet and toss well. Add the butter, season with salt and pepper and toss again. Transfer the spaghetti to bowls and serve, passing the grated cheese at the table.