Yes, spraying raid prevents cockroaches—it contains chemicals that are toxic and kills roaches. Since roaches are mainly found in kitchens and bathrooms, you should spray raid near the doors, windows, and floors to prevent the entry of cockroaches.