Banefire checks the number you chose for X, not the amount of mana you actually spent.

2/1/2009

Banefire can be targeted by spells that try to counter it (such as Countersquall) regardless of what the value of X is. If X is 5 or more, those spells will still resolve, but the part of their effect that would counter Banefire won’t do anything. Any other effects those spells have will work as normal.

2/1/2009

Banefire’s ability won’t prevent it from being countered by the game rules if its target has become an illegal target.