Heb harak, meaning "to grate the teeth", (Job 16:9; Ps 112:10; La 2:16), denotes rage or sorrow. (See also Ac 7:54; Mr 9:18.)
And wherever it seizes him, it throws him down; he foams at the mouth, gnashes his teeth and becomes rigid. I asked your disciples to cast out the spirit, but they could not."
Now when they heard this they were cut to the heart, and they gnashed their teeth at him.