Mana abilities are a special category of activated abilities that do not use the stack and cannot be responded to. Because they resolve immediately, players are allowed to activate them at almost any time, including during another player's turn or while spells and abilities are waiting on the stack.
Under CR 605.3a, a player may activate a mana ability whenever they need mana — most importantly, this can happen even without that player holding priority. The rules specifically carve out mana abilities from the normal timing restrictions that govern other activated abilities (CR 116.1a, 605.3b).
Lands that produce mana (e.g., a basic Forest's '{T}: Add {G}') have activated abilities that meet the definition of a mana ability under CR 605.1: they aren't loyalty abilities, don't target, and could put mana into a mana pool as part of their resolution. Such abilities skip the stack entirely (CR 605.3a).
Example: Your opponent casts Lightning Bolt targeting your creature. Before you decide whether to respond, you tap a Forest to add {G} to your mana pool — perhaps to help pay for a response spell. This is perfectly legal. The Forest's mana ability resolves immediately without going on the stack, even though Lightning Bolt is already there.
So yes, you can freely tap lands for mana while any spell or ability — yours or an opponent's — is on the stack. Just remember the mana will empty from your pool when the current step or phase ends (CR 500.4), so plan accordingly.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.