New products or investment opportunities can blow a hole in well-planned budgets. Here’s how companies adapt.