Yes, and that is usually how people play it that way they don't lose their creature. And if the cards are being used on attacking creatures they could even play it before blockers are declared as well. Instants can be played in response to almost everything that happens.
First, Celestial Flare doesn't target a creature. It targets a player.
Second, players must pass priority during each step or phase except untap and cleanup. Once all players pass priority in succession, the game progresses to the next step or phase. This means you may cast Celestial Flare during any step in the combat phase. If you cast it before the damage step, you will cause the attacker or blocker to be sacrificed before combat damage. That creature will neither deal nor receive damage.
Same with Azorius Charm .
@GinjaNinja: Your last sentence is misleading. Instants may only be cast when you have priority. You can't respond to turn-based actions like drawing a card in the draw step, declaring attackers, etc.
That's why I said almost, but you are correct, i apologize I should have either been more specific or named things that it excludes.
Thank you for the details Epochalyptik.
Now what about playing it after declaring blockers, but before the damage step. If I declare to block my opponent's creature, and then Azorius Charm my blocker, does the attacking creature end up still doing damage to me, or will it do damage to nothing since the blocker is gone?
You don't receive any damage because the creature is still considered blocked . . . unless of course the blocked creature has trample, then you will receive damage.