A family’s love for their pet pooch is reciprocated mightily in writer-director Mitch Davis’ “The Stray,” a movie with a gentle spirit and tone shifts that go all over the place.

The opening sequence hints at something harrowing in the movie’s narrative: A man and three 9-year-old boys are camping, and their tent is struck by lightning. Then the movie rewinds a year, to 1990, and we learn that man is Mitch Davis (played by Michael Cassidy), when the filmmaker was a young, overworked studio executive in California.

Mitch has a devoted wife, Michelle (Sarah Lancaster), and three kids. He never has time for his family because of the workload of reading scripts and commuting. His schedule is particularly hard on his oldest son, Christian (Connor Corum), who grows to resent his father for being gone all the time.

Mitch makes a half-hearted suggestion that the family get a dog, an idea Michelle opposes. But a stray brown-and-white mutt suddenly shows up at Christian’s school, defending him from bullies. The stray follows Christian home, so the family end up adopting him and naming him Pluto.

Pluto joins the family when, after a near tragedy that drives home Mitch’s workaholic issues, they move to Colorado, where Mitch is determined to become a full-time screenwriter. (The movie was filmed in Utah, not Colorado, so Mitch has already learned the importance of keeping location costs down.)

When not typing on his now-vintiage Apple computer, he also tries to repair his relationship with Christian. Mitch is sure a camping trip with his son and two of the boy’s friends, Smitty (Brennan Williams) and Clark (Enoch Ellis), should do the trick.

Basing a family-friendly drama on an incident in one’s own past is a risky proposition for any filmmaker, and Davis (best known for his 2001 LDS missionary drama “The Other Side of Heaven”) pours his heart into it. It’s also a family affair, since Davis’ youngest son, Parker (who wasn’t born when the events depicted took place), wrote the first draft; another son, Marshal, edited the film; and oldest son Christian composed the score.

The tone veers from slapstick comedy (with Pluto peeing on a rich guy’s Beemer — twice) to tearful dramatic moments in the aftermath of the lightning strike hinted at in the opener. There also are many instances when the characters stop and pray in crisis moments, which some will find inspiring and others may find grating.

Cassidy (who played Jimmy Olsen in “Batman v. Superman”) gives a solid performance as the overworked Mitch, and Lancaster (who had prominent roles on the TV shows “Chuck” and “Everwood”) plays Michelle as the family’s rock, reminding Mitch of what really matters as this warm-hearted story unfolds.

* * 1/2

The Stray

A family’s dog becomes a hero and a protector in this faith-driven drama, filmed in Utah.

Where • Area theaters.

When • Opens Friday, Oct. 6.

Rating • PG for thematic elements including a perilous situation.

Running time • 87 minutes.