G., I'm sorry this is happening to you. As others have said, if this did seem to begin rather unexpectedly about five years ago, and before that she was not as hyper-critical and rude as she has become, there is a good chance that Alzheimer's or some other form of early dementia is at work. Personality change is an early indicator and for some people that change unfortunately is a swing toward cruel and rude verbalization.
Here's another thought: You mention that "in rare occasions she can be pleasant." Sit down and really think hard: Are those occasions tied to something specific? For instance, is she pleasant when you and she are doing some particular type of activity, such as going on an outing, eating a meal, taking the kids to an event? (Those are just ideas; you will know what activities are her "pleasant" ones.)
If there is any slight predictability to when she may be more pleasant, then build all your contact with her around those activities. If a casual visit with sitting and chatting will always turn into criticism, but walking through a mall won't because she's focused instead on talking about what's in the store windows -- well, arrange mall meet-ups but don't drop in at her house. If she is likelier to be critical and cruel when at your house, invite her somewhere neutral instead. If she's pleasanter when your son is not around -- I hate to say it but see her without him, at least for now. If she seems mellower in the mornings, stick only to mornings when you phone her or see her. You might need to spend a bit of time really mulling over each time you've seen or talked to her and whether certain triggers like location, time of day, whether she'd just eaten or was hungry--anything--could indicate when are the better times to be around her.
All of that, of course, depends on the vital question of whether you even really want to keep up a relationship with her. If your relationship prior to these past few years was a good one, with positive memories, and if the criticism and negativity are really only over these past few years, you may want to keep up your relationship because it would seem that the change could be medically related and shouldn't obliterate a lifetime of good relations. But if she has always had a strong critical streak and the inability to curb her comments, then you could reconsider having much contact with her. Only you know if your prior relationship was a normal and overall good one.