A couple other points in case anyone is confused about how bonuses work in regards to the salary cap - the bonus money is paid to the player when he signs the contract. This is why he'll often sign for a higher bonus when the base salary is large in the later years; the bonus he pockets right away, but you are off the hook for the base salary if you cut the player. The salary cap takes that bonus and distributes it equally across the life of the contract. If you cut the player, trade him, or he retires, his future bonus cap hit is accelerated into the following year.
When you renegotiate a player who is currently under contract, his total future bonus cap hit cannot change. So if a player has a 4-year contract with a $400,000 bonus and you renegotiate in his second year another 4-year contract with a $400,000 bonus, the $100,000 for the remaining two years of his original contract will still apply - meaning that the first two years of the new contract will each have a $200,000 bonus cap hit, followed by the last two years with a new $100,000 cap hit.
So the bonus is a double-edged sword. It will make your offer more lucrative to the player, but it also can bite you in terms of future renegotiation or cuts and trades.