How to best handle negative, critical people

My sister, my husband’s sister and my mother in law are all very negative, critical people. More often than not the only thing they talk about is how great they are and how other people just don’t measure up. It’s like nails on a chalkboard to me and it’s so hard to be around. I, of course, love these people but it’s hard to even like them when they are being like this. As I feel my frustration rise I feel the spirit leave which then makes me not want to be around them. A huge concern of mine is my daughters picking up on this behavior and thinking it’s ok.