Poker etiquette suggests that you don’t criticize someone for their poor play, especially if you are in a cash game. This advice applies to both online games as well as face to face games (I image that there is more risk being critical in person than online).
There are a couple of reasons for not being critical. One is that it will make you look like a jerk, and two you might actually influence the person you are criticizing to play better, or worse, leave the table. At a cash game, your goal is to maximize your profits, not chase them away. If you happen to get beat because a person stayed in the game with a hand that should have folded, your best response would be to smile slightly and say “nice hand” and try to forget about what has happened. You don’t want to go off tilt and start playing poorly yourself. It is not easy sometimes, but take time and cool down, then get back into your game.