The Pathfinder 2 way.
PF2 has the general Counteract mechanic:
Critical Success Counteract the target if its counteract level is no more than 3 levels higher than your effect’s counteract level.
Success Counteract the target if its counteract level is no more than 1 level higher than your effect’s counteract level.
Failure Counteract the target if its counteract level is lower than your effect’s counteract level.
Critical Failure You fail to counteract the target.
(critical success and failures being when you roll ten or more higher or lower than the DC)
You expend a spell slot containing the same spell and roll to counter the cast spell, with varying possible degrees of success.
You can later specialize it in various interesting ways with feats, for example one that lets you spend a prepared spell from merely the same school, or with a spell that is especially thematically appropriate, or redirect the countered spell, or just eat it.
It's a whole mechanic that you can build around, it's exciting when it happens, you feel like you've earned it. It's a reward for clever play as opposed to a button that you push.