Burning a spaghetti sauce usually occurs when the temperature is too high and the sauce is lefty unattended and unstirred. As long as the burnt flavor has not infected the entire sauce, you can probably remedy the situation. Keep in mind that you will have to dilute the sauce in order to do it effectively, and this may significantly extend the cooking time you had originally planned on. Keep tasting the sauce throughout the fixing process to ensure desirability.
Shut the heat off immediately. Take the pot off the burner and move it to a cold one.
Do not scrape the bottom of the pot. That would allow the chunks of burnt or overly browned material to assimilate into your sauce.
Dump the contents of the sauce pan into another, similar size sauce pan. Soak the former pan in warm water and dish detergent for easier cleaning later.
Add more tomato base to the sauce. Use the most naturally sweet tomato product you can, as sweetness will allay any enduring bitterness caused by the burning. Sweet onions like Spanish or Vidalia are another tool. If absolutely necessary, use sugar or another sweetener. However, add sweetener gradually as the sauce reheats to regulate the sweetness level. Remember one of the cardinal rules of cooking: You can always add more, but you can never take it back.
Allow the sauce to re-reduce on the stove at low to moderate heat. The recently added base will thin out the sauce again, so this step is necessary to achieve proper consistency.
Stir the sauce constantly from the bottom up to prevent it from burning again.
Adjust herbs, garlic and other flavors to further remove any trace of bitterness. Sweet basil is a primary option here.
If you taste the original sauce and it has a thoroughly burnt taste, you need to throw it out. It cannot be recovered.