If one of the keys to writing a successful play is to find a subject that everyone can relate to, then Bedford playwright Melinda Lopez may have hit a gold mine.

In her new play, Lopez fictionalizes many of the moments – some funny, some touching – that she experienced while caring for her parents in their old age. For anyone with a mother or a father, it’s an issue that’s as inevitable as the passing of time.

“It felt like everyone I knew was going through it at the same time,” says Lopez. “One of the things I came to realize is that it’s the most ordinary thing in the world, yet it’s so hard to talk about. We’re shielded from it, for good reason: It’s scary and painful.”

And yet Lopez has spun it into a comedy, “Mala,” playing Oct. 27 to Nov. 20 at the Black Box theater at the Paramount Center in Boston.

“As dark as the subject may sound, it’s actually a series of comic misadventures,” says Lopez. “There’s a lot of humor in family dynamics. Mala is trying hard to be a good daughter and care for her parents. She’s trying to live up to an ideal, and she isn’t always succeeding.”

Lopez says humans use humor as a coping mechanism, and she certainly needed a way to cope, as both her parents lived with her at the end of their lives. Her father passed in 2014, and her mom died nine months later at home.

The process of writing the play began as a kind of therapy session. In her new role as caregiver, Lopez hit moments of high stress. She vented by typing her frustrations into the notes page of her iPhone.

Playwrighting? Yeah, there’s an app for that.

“Part of my experience was feeling frequently overwhelmed, and the only outlet I felt I had was my cell phone,” she says. “I started writing notes to myself. Things like: ‘I’m going crazy – is it me or is it her?’”

Those notes would later become the entry point for “Mala,” a one-woman one-act featuring Lopez as both writer and performer. The play mines familiar territory for Lopez, a first-generation American whose parents were born in Cuba. Lopez feels that many of the challenges that she faced as primary caregiver were typical of Cuban and Latin-American families.

“It’s kind of expected that the daughter will step up and take over” when the parents age, she says. “But I don’t feel that’s exclusive to Cuba and Latin America. I think you also see it in Italian, Jewish, and Indian families, and others. It’s pretty universal.”

Many of Mala’s struggles were Lopez’s struggles.

“Mala’s mother is very strong-willed,” says the playwright. “She throws out caregivers, she refuses to go to the hospital after falling. Mala and her mother butt heads on everything. They fight over who’s the parent, and there’s no right answer. One day, the mom is the parent; the next day, Mala is the parent.”

And one day, the parent became a fan of theater. It’s a testimonial to Lopez’s mom and dad that although they didn’t grow up surrounded by art, they became big fans of their daughter’s career path.

“They were so supportive,” says Lopez. “They loved that I loved what I did. That was so important to them. They would not have been theatergoers, if not for me. But they came to see everything I did. And they were so ready and willing to learn.” And then Lopez adds, with a laugh, “I think they would have loved it if I had become a doctor, but they loved that I was happy.”

And they could be proud of her success. Not only have Lopez’s plays been produced at prestigious theater companies such as Steppenwolf and the Williamstown Theatre Festival, Lopez is also the playwright-in-residence at the Huntington Theatre Company, a position funded by the Mellon Foundation. Her tenure was recently extended through 2019.

It’s interesting to consider what Lopez’s parents would have thought of “Mala.” We know they would have recognized the lead character.

“The trick is to be honest about yourself,” says Lopez. “Mala has many flaws. We’re not creating heroes here. This isn’t a play that’s telling you how to handle this situation of aging parents. Mala doesn’t have a lot of wisdom, she just has a story to tell.”

And although this is a subject that could easily inspire a treacly Lifetime movie, Lopez made sure to strip her story of sentimentality and nostalgia. She says that’s what theater audiences deserve.

“Losing a loved one is a painful experience,” she says. “You want to forget it, you want to whitewash the experience. But I don’t think that’s what theater should do. Theater exists as a place to talk about profoundly human experiences. It’s a sacred space where you can share something that’s unsentimental and honest. And I haven’t seen that before on this topic.”

Even if Lopez hasn’t hit a gold mine, she’s at least hit a nerve. Although this production marks the world premiere of “Mala,” Lopez has had several readings of the play, and she’s already noted the desire of audiences to relate their own experiences with aging parents.

“Everyone wants to tell their story,” says Lopez. “The play really seems to invite people to talk, which theater doesn’t always do. And as I was writing the play, so many friends would share their stories, so some of their experiences are in the play. The sharing of the experience is what makes it bearable.”

“Mala”

WHEN: Oct. 27-Nov. 20

WHERE: Black Box theater, Paramount Center in Boston

TICKETS: $60

INFO: 617-824-8400, www.artsemerson.org