We derive the optimal policy mix of Research and Development (R&D)-subsidies and corporate tax rates towards a footloose R&D-intensive firm. Increasing R&D-subsidies strengthens the firm's incentive to offshore production. The firm's home government can offset this by offering an appropriate corporate tax concession. The optimal policy package exhibits a "Matthew principle": higher R&D-subsidies should typically be accompanied by lower tax rates. However, if the R&D-subsidy exceeds a crucial threshold, a tax concession can no longer prevent offshoring. We find that it is never optimal to raise tax rates as R&D-subsidies increase.