I'm mostly going to be focusing on stories about masculinity here rather than stories about the marginalization of women. Chances are that if you're going out of your way to write a story about the marginalization of women, you're also going to go out of your way to write the women well. We'll get to that in a minute. I want to talk about the question of masculinity first, because things get incredibly tricky there. For one thing, some writers claim to be about "definitions of what it means to be a man" when they're actually about "definitions of what it means to be a human being;" the male writer doesn't realize that the issues he thinks are specific to masculinity are actually pretty universal. Joseph Campbell is our most facepalm-inducing example here. When asked what a Heroine's Journey might look like to complement his Hero's Journey, he replied, "Women don't need to make the journey. In the whole mythological journey, the woman is there. All she has to do is realize she's the place people are trying to get to." So . . . personal and spiritual growth and struggle are unique to men, apparently.
This one of the more egregious examples of this mindset, but it isn't the only one. If you think your story is uniquely male, try talking about the themes with some of the women in your life. If they're nodding enthusiastically and sharing their own experiences, it isn't uniquely male. They've been there.
But some stories really do work better with men. Breaking Bad is a good example here; it just wouldn't have the same punch without Walter White's sense of thwarted masculinity bouncing off Jesse's feelings of impotence and Hank's macho posturing. As mentioned, crime novels and shows like The Wire fit here as well--criminal groups usually have a culture of toxic masculinity, and the cops can be held up either as a positive counterexample or a cynical mirror group that's nearly as toxic as the crooks. Also, the more we have stories like these that deconstruct traditional notions of what it means to be a man, the more we need stories to build up new visions of masculinity in their place. As male-dominated as stories tend to be, we still need good stories about men and manliness if we're going to have examples of how to be a man who doesn't adhere to some strict macho role.
So let's say you're writing one of those stories, but you're worried that women are absent or underused. Are there any themes other than masculinity that the women can represent? This is one of the areas where Breaking Bad drove me bananas, as much as I loved it. One of the crucial themes was masculinity, but another crucial theme was family, so the relationship between Skyler and Marie really should have been more important. The show flirted with this in early episodes but basically shoved their relationship (and most attempts at character development for Marie, for that matter) under a rug. The show frustratingly failed the Bechdel test more often than not. It didn't have to. Skyler couldn't act as a parallel to Walter on the theme of masculinity, but she could have acted much more strongly as a parallel or foil to him on the theme of family. (I'm curious about whether Anna Gunn would have gotten more or less hate mail in this alternate reality . . .)
You may still find yourself in a situation where men are ruling the roost and flunking the Bechdel test because of your story's themes. There are plenty of examples of this happening--The Godfather and all those crime novels come to mind, although The Wire doesn't thanks to Kima and her girlfriend. (And possibly Ronnie. Do Ronnie and Kima ever have a conversation that isn't about a man?) Unfortunately, I can't get into a lot of detail on these kinds of stories because I don't enjoy them very much. Men don't tend to read Jane Austen even though she's a great novelist, and if they do read her, they don't tend to enjoy her as much as women do. I wonder if I'm the only woman who secretly thinks The Godfather is hella overrated because it's too darn butch for me. If you're writing something aggressively masculine, you risk alienating half your potential audience. That's fine--everyone knows you shouldn't write something with the sales figures in mind--but please know it going in, because I'm tired of the conventional wisdom that everyone enjoys boy stories.
Ahem. Anyway. As I was saying, if you're absolutely in a situation where the men are ruling the roost because of your story's themes, though, your best bet is to go out of your way to make sure your women are interesting characters with agency. Of course, you should make sure that all of your characters are interesting--no one sits down at their desk delighted at the thought of writing a really boring character today--but if you have an engaging female character from the start, you'll gain a lot of trust and traction with your women readers. The Wire gets a lot of flak for its female characters, but to my mind it does this right; I may not typically enjoy macho stories, but I'm one of those annoying Baltimoreans who will talk your ear off about The Wire. Kima's an obvious reason why--I don't know if I would have had as much initial buy-in with the show if Kima hadn't been such a fantastic character, with a personal life and strengths and flaws just like all the men--but even minor characters who really do exist solely as foils for the men tend to pull this off beautifully. Our Barksdale gang Mother of the Year winners Brianna Barksdale and De'Londa Brice mainly exist to show some of the poisonous ways that family affects gang life, but you can understand how each one sees herself as the heroine of her own story--and Brianna in particular is as nuanced and interesting as any of the male criminals. Perhaps best of all, when a first season episode gives us a fairly typical scene of how disposable women are in gang life--a stripper, Keesha, overdoses at a party and her body is thrown in the Dumpster--it goes in a completely different direction than these scenes usually do. Rather than being used as a cheap shock moment, or something that kicks off a man's soul-searching journey of self-discovery, it leads to another woman's soul-searching journey of self-discovery as gang girlfriend Shardene realizes that Keesha's fate could have been her own. She ends up taking actions that critically change the course of the first season because, like Brianna and De'Londa, Shardene is the heroine of her own story.
So is everyone, including your female characters. Even if your story is a necessary Bechdel fail, the best way to keep it from being sexist is to treat them that way. Your sole female character may only be onscreen for twenty pages of a three hundred page novel, but if you know exactly who she is, why she's there, and what she thinks about the events going on around her, you'll be
Now, if you'll excuse me, I have to go rewatch The Wire.