Consider the card Harm's Way or similar. The Oracle text states:
The next 2 damage that a source of your choice would deal to you and/or permanents you control this turn is dealt to target creature or player instead.
When does this instant need to be cast to prevent a creature from dying? I guess the latest point by which it needs to be cast when blockers are assigned, if it were assigned later then it seems it would not longer be of any help.
510.2. Second, all combat damage that’s been assigned is dealt simultaneously. This turn-based action doesn’t use the stack. No player has the chance to cast spells or activate abilities between the time combat damage is assigned and the time it’s dealt. This is a change from previous rules.
510.3. Third, any abilities that triggered on damage being assigned or dealt go on the stack. (See rule 603, “Handling Triggered Abilities.”)