If you encounter these before you have a unicorn horn, then Elbereth may help to avoid being hit; if you have no means of curing disease in your inventory, be prepared to pray after fighting these. Late in the game, these may be summoned by aligned priests who cast summon insects; your AC should be low enough by then to dodge the majority of locust attacks, so the unicorn horn remains a sufficient way to cure their disease.
Encyclopedia entry (UnNetHack)
A minute invertebrate animal; one of the class _Insecta_. The
true insects or hexapods have the body divided into a head,
a thorax of 3 segments, each of which bears a pair of legs,
and an abdomen of 7 to 11 segments, and in development usually
pass through a metamorphosis. There are usually 2 pairs of wings,
sometimes one pair or none.
[ Webster's Comprehensive International Dictionary
of the English Language ]
Else, if thou refuse to let my people go, behold, to morrow will
I bring the locusts into thy coast:
And they shall cover the face of the earth, that one cannot be able
to see the earth: and they shall eat the residue of that which is
escaped, which remaineth unto you from the hail, and shall eat every
tree which groweth for you out of the field:
And they shall fill thy houses, and the houses of all thy servants,
and the houses of all the Egyptians; which neither thy fathers, nor
thy fathers' fathers have seen, since the day that they were upon the
earth unto this day. And he turned himself, and went out from Pharaoh.