It means to be extremely angry.It is also used when someone is extremely excited about something i.e we use foam at the mouth when someone is uncontrollably excited or angry.So this idiom is used when anything is extreme.
Other derived forms include:
foams at the mouth, foaming at the mouth, foamed at the mouth
1)When she saw her son's progress report, she was almost foaming at the mouth .
2)The dog was foaming at the mouth at the passerby and looked quite dangerous.
3)He was foaming at the mouth at his employees for the poor work done so far.
4)Why are you foaming at the mouth unnecessarily?
5)Don't foam at the mouth like that at me ,I won't take it.