Ferocious lasers are set to be fitted to four Royal Navy warships as the government intends to invest in new technologies.