For a sentence like
we see its structure as A, B, C.
where B is a phrase that is set off by commas. It's set off by commas because it's not essential—the rest of the sentence can stand alone as a complete sentence without it.
Now if you've learned about dashes, you'll know that you can also use dashes to set off the nonessential phrase:
There is no difference except in style. The dashes are used for more of a dramatic effect. You typically won't want to use dashes in a sentence like this, but it's grammatically correct.
So what's the point of this example?
When setting off a nonessential phrase in the middle of a sentence, we must use a pair of commas or a pair of dashes.
We can't, for instance, start with a comma and end with a dash. The following sentence is wrong:
A comma can only pair up with another comma, and a dash can only pair up with another dash. It has to be consistent.
Now here is how the ACT will trick you. They'll give you a sentence like this
This is an actual ACT question, but I'll leave out the answer choices. For our purposes, we just want to know whether it's grammatically correct or not, and if not, how to fix it.
Based on what we learned earlier, your immediate reaction might be that the sentence is wrong because the dash and the comma should not be paired up together in a A, B—C sentence structure.
However, this is an incorrect reading of the sentence. Why? Because B is not the nonessential phrase that needs to be set off. It's B+C that's the nonessential phrase.
Look at B+C. If you take them out of the sentence, you're left with
I ride this trail nearly everyday.
This is a complete sentence all by itself. Therefore, B+C is nonessential and should be set off with just one dash or comma. You need to read the sentence as A—B, where A is the main sentence and B is a trailing nonessential phrase. It's two parts instead of three.
This sentence was correct all along.
The comma before "but" is simply a pause. It has nothing to do with the dash. In fact, this comma is optional. On the surface it looks like they should pair up but they shouldn't. They're used for separate reasons. The ACT constructed a sentence like this to trick you into thinking they need to pair up with each other.
Now compare this example with our first example. In the first example, A+C constituted the main sentence and B was a nonessential phrase interrupting in the middle. That's why we needed the pair of commas. In this example, the main sentence, A, is uninterrupted since the nonessential phrase, B, comes at the end.
Hope this helps you understand yet another nuance that can appear on the ACT English section. Note that the purpose of this post wasn't to explain when to use dashes but to analyze a tricky case involving them. For a refresher on dashes, check out this post.