Preheat your oven to 425°F. Line a rimmed baking dish with high-heat-resistant parchment paper.
Pierce the squash in a few places with a fork and microwave it for 1 minute to slightly soften.
Using a large, sharp knife, cut the squash in half lengthwise. Place it on a sturdy cutting board, and work very carefully. First, slice off the stem end of the squash, then stand it upright on this flat end and carefully use your knife to cut it in half.
Using a large metal spoon, remove the seeds and pulp.
Lightly spray the cut side with olive oil and, if you wish, sprinkle it with salt and pepper. Place the squash halves, cut side down, in the prepared baking dish.
Bake the squash until fork-tender, for about 40 minutes.
Transfer the cooked squash to a cutting board and allow it to cool until easier to handle, for about 10 minutes.
Rake a fork back and forth across the squash to remove its flesh in strands, transferring the strands to a bowl. Use as a side dish (try mixing melted butter, garlic granules, and grated parmesan into the hot strands) or as the basis for other recipes.
Video
Notes
The reason I microwave the squash briefly before baking it is that it slightly softens it, making it easier to cut.
Overcooked spaghetti squash can become mushy, so start checking on it after about 30 minutes in the oven. As soon as it can be easily pierced with a fork, pull it out of the oven.
Like most cooked leftovers, you can keep the cooked squash strands in the fridge, in an airtight container, for 3-4 days. Although the strands won't be as perfect as when they first emerged from the oven, you can reheat them in the microwave or in a 350°F oven. In fact, if your squash ends up mushy, spreading the strands evenly on a baking sheet and reheating them in a 350°F oven is a good way to improve their texture.