Observing that countries like Russia and China are modernising their militaries to close the gap they have with the US, Defence Secretary Ashton Carter on Tuesday said the Pentagon is spending heavily to develop next generation of technology to stay ahead of the curve.