Paying for a spell is the last layer of casting it. Then it goes on to the stack. Now would be the time you could add other things on the stack to untap a merfolk for example. But the spell is already on the stack and the cost needs to be payed at that point. Hope this is not too confusing :)
January 6, 2018 4:51 p.m.
Exotryptan, actually the spell/ability goes on the stack as the first step in casting/activating it. You are correct that paying costs is the last step of casting/activating spells/abilities, but the object is put on the stack as the first step. This matters in very specific corner cases such as with Acceptable Losses, when the additional cost of discarding a card a random is being payed Acceptable Losses is on the stack, not in your hand.
601.2a-i tells us that the steps to cast a spell or activate an ability are:
a Put the object on the stack.
b Announce choices for modes, kickers, buybacks, values of variables etc.
c Announce number and choice of targets,
d Announce division or distribution of effects.
e Game checks legality of casting the spell/ability and rewinds if illegal.
f Total cost of spell is calculated.
g Player gets a chance to activate mana abilities if cost includes mana payment.
h All costs are paid at the same time.
i Spell is cast or ability is activated.