Investment in advanced defense technologies is a prominent characteristic of modern armed forces. The paper examines the optimal investment policy in developing such technologies, accounting for their S-shaped progress profile and the stochastic nature of the R&D process. We show that the optimal investment is a discontinuous function of the available budget, and that its dependence on technological uncertainty is non-monotonous. We further show that maintaining the flexibility to adjust investments along the R&D program is beneficial.