Are they ASKING for advice? It didn't seem that way from what you mentioned in your post, so maybe they are not expecting advice, but someone to listen, a shoulder to cry on, maybe have a personal anecdote to share regarding the subject, or someone nice enough to listen, sympathize and understand, without judging them or even taking sides. They want a neutral party. They obviously didn't feel comfortable enough telling someone like a co-worker, maybe they felt that unlike a co-worker or relative, you wouldn't judge. The best thing you can do is listen and say something like "wow, I am sorry, marriages can be tough, and nothing is perfect. I am sorry you feel this way". This shows empathy, the fact that you're listening, and not pointing fingers at anyone. IF they DO ask for advice, then you can just say you are not a psychotherapist and cannot offer advice, but that you have no problem listening to them if all they need to do is vent, something which is normal and healthy, rather than keeping their anger all pent up. Help them find a marriage counselor if necessary to show you care enough about them resolving their problem. Is it something major like cheating or more on the lines of "I am so sick of John, he never picks up his underwear from the floor"? Such small issues may not require a counselor, just some talking with their spouse, so maybe that's the sort of advice you can give..."Why don't you tell John how frustrated you are for having to pick up after him and ask him to please throw the dirty underwear in the hamper?"
I know I feel MUCH better after venting out, it's like I can let go of my problem and stop holding a grudge, so maybe that's all they are doing. I call my mother to vent about men as I don't like other people knowing my personal business and she will usually say something like "Well, men are hard to live with, they can be selfish, I remember when your dad did something similar...." and she will tell the story. This helps me feel like I am not alone and that she cares enough to be there for me.