Answer: As Lightning Bolt resolves, it deals 3 damage to the Tarmogoyf, which is a 2/3 as that happens. As the final step in the resolution of Lightning Bolt, however, it is put in the graveyard, which immediately makes Tarmogoyf a 3/4, because Lightning Bolt is an instant, which is a new type in graveyards. Since Tarmogoyf's power and toughness is a characteristic-defining ability, it does not use the stack to change. It updates constantly, no matter which zone it is in. Then, just before players would receive priority and after Lightning Bolt has already resolved and gone to the graveyard, state-based actions are checked. At this point, Tarmogoyf is a 3/4 creature with 3 damage marked on it, and it will not die.
Hard: Ansil activates his copy of Inkmoth Nexus and attacks Nicole. Before damage, Nicole casts Collected Company and puts Melira, Sylvok Outcast on the battlefield. If Nicole assigns no blocks, how much damage is dealt and how is it dealt? What if Ansil activates Inkmoth Nexus’ ability a second time before damage is dealt? (Credit: Jarrod Feight)
Answer: Melira has an ability that removes certain abilities from creatures, and Inkmoth Nexus has an ability that grants certain abilities to itself. To see how to apply these abilities, we have to look at layers. In particular, we are looking at the Abilities layer, as that is where both of these abilities function. Since there is no dependency, we apply effects in timestamp order. That means that first, Inkmoth Nexus gains flying and infect until end of turn, and then Melira causes Inkmoth Nexus to lose infect. Inkmoth Nexus is now a 1/1 Blinkmoth artifact creature with flying that does not have infect and will deal regular damage in combat. If Ansil activates Inkmoth Nexus' ability again before damage, it remains the same creature, so it gets to stay in combat, but we now have another new ability to apply. It is last since we are still using timestamp order, so after Inkmoth Nexus gains and then loses infect, it now gains infect (and flying) again, because Melira goes not prevent a creature from gaining infect. That means that Inkmoth Nexus will deal infect damage, which is in the form of poison counters when damaging a player. Since Melira also says that Nicole cannot get poison counters, however, the damage will do nothing. It is still dealt, but its effect has been negated by Melira's abilities.
Corner Case: Nathan controls a Burrenton Forge-Tender. Antonio casts a Goblin Guide. In response, Nathan sacrifices Burrenton Forge-Tender, choosing Antonio's Goblin Guide on the stack as the red source. When Antonio attacks with the Goblin Guide that turn, will it deal damage?
Answer: A player can choose basically any relevant permanent, object, or spell when an ability calls for a source of damage, as long as the choice fits any requirements (here, "red"). That means that Goblin Guide is a legal choice while it is on the stack. Furthermore, according to CR 609.7a, if that source is a permanent spell on the stack, the prevention effect applies to both that spell while it is on the stack and the permanent it becomes on the battlefield. Even though the Goblin Guide is a new object when it resolves, the ability of Burrenton Forge-Tender will still prevent the damage from Goblin Guide.