Rules of Instants. MTG
Yes, you can do that.

The combat phase is divided into 5 separate steps:


1) Beginning of Combat
2) Declare Attackers
3) Declare Blockers
4) Damage Assignment
5) End of Combat


In the Declare Blockers step, after the defending player has decided how to block the attacking creatures, each player gets priority before moving on to Damage Assignment. When the attacking player has priority, they can cast an instant or activate an ability that would pump the attacking creatures.

From the Basic Rulebook:


  
  Combat Phase
  
  
    c. Declare blockers step
    
    
      Your opponent decides which, if any, of his or her
      untapped creatures will block your attacking creatures,
      then they do so. If multiple creatures block a single
      attacker, you order the blockers to show which is fi rst
      in line for damage, which is second, and so on. Players
      can then cast instants and activate abilities.