Like any committed churchgoer these days, I’ve long known that the church is graying fast. But even so, I was taken aback recently when a friend said to me, “You and my grandmother are the only people I know who still go to church.”

I’m only 28, but after thinking about it, I had to admit he was right. It’s not often that young people in the church see others there who look like us and share the same interests and even vocabularies -- especially in positions of leadership. No wonder church is about the last place that many young adults want to spend their time.

While the aging of the church may not be news to anyone, what is news is that an easy solution is at hand, but only if the church is willing to have some faith and trust in young people. It is past time to give them the responsibility and opportunities for leadership that would bring them more fully into the life of the church.

Nowhere is the church’s “maturity” more evident than in communities of women religious, the Catholic nuns who are responsible for so much of the church’s good works. Today, the average age of a Roman Catholic sister in the United States is 74, The New York Times reports, and in many communities, it’s well into the 80s. Ordained Catholic priests are a bit younger, with an average age of 63 -- but that’s up from 35 in 1970, and rising fast. Mainline Protestants such as the United Methodist Church are facing their own challenges, experiencing drops in vocations that keep pastors working longer into their later years.

But if the church is at the terminal end of the age spectrum, Silicon Valley, one of the most vibrant economic centers in our country, is at the other.

At Facebook, the median employee age is 28, the Times reports, while at Google it’s 29 and at AOL, 30. As Katie Bardaro, the lead economist at PayScale, told the Times, “The firms that are growing or innovating around new areas tend to have younger workers. Older companies that aren’t changing with the times get older workers.”

She could have been talking about the church. Apparently, like attracts like; vitality attracts vitality.

When I was a student at Yale Divinity School, I once attended a retreat in which one of the participants was a woman in her early 30s who had previously considered a vocation to religious life. She had even gone so far as to enter a community as a novice, but she didn’t stay long.

By far the youngest member, she told me, she felt as though her energy was not valued. She had to dress in a way that she thought was inappropriate for her age. And although she loved being with the sisters, there was no one in the community to whom she could easily relate.

I don’t recount her story to beat up on nuns. In spite of their aging numbers, these tireless women still care for the poor and marginalized in ways that put my own charitable efforts to shame. And of course, the most electric religious leader in the Christian world at the moment is a 76-year-old man living in Rome.

Still, I suspect that my friend’s story represents many of the challenges facing the church today, Catholic and Protestant. Unless something changes soon, it highlights a crisis-in-waiting for the church’s future.

The way to prevent that crisis from happening is to bring a bit of Silicon Valley into the church, inviting young people -- especially those in their teens and 20s -- into meaningful positions of leadership and responsibility. For both the church and young people, it would be a “win-win,” at once evangelizing and strengthening the faith of young leaders and increasing the vitality, creativity and energy of the church.

I know the power of such invitations. As a high school student, I was active in my parish, St. Francis of Assisi, in Dracut, Mass. Perhaps sensing that I was discerning a vocation to the priesthood, the pastor often invited me to serve in a variety of leadership roles.

He called on me to read Scripture and distribute communion at Mass. He asked me to teach religious education to fifth graders. He hired me to assist the grounds crew one summer, mowing the lawn and cleaning windows. Eventually, he asked me to attend parish council meetings, giving me a literal place at the table with the adults.

By the time I reached college, I no longer needed to be invited -- though others did continue to encourage me, asking me to join the school’s liturgical choir, read at Mass, or go on service trips. By then, I was fully invested in religious life, both back home and on campus. I knew that young people could be valued leaders in a faith community, and I felt that I should step up and help.

I didn’t become a priest, but I am still active in the Catholic community, working for a couple of Catholic nonprofits and writing about the Catholic Church for a variety of publications. I go to Mass each week, participate in a Jesuit leadership group for young adults and count more priests among my friends than most 28-year-olds do.

There’s no way to know what other path my life might have taken had my pastor not invited me to serve in all those positions. But looking back, it’s hard to see what would have stopped me from just drifting away, like my many high school friends who now have nothing to do with the church.

My pastor’s invitations were much more than just kind requests. They were evangelization tools, and they worked.

Last month, I attended a Mass at Georgetown University that was filled to capacity. Before the service began, excited chatter filled the chapel. Darting from row to row, students smiled as they hugged and greeted one another. Amidst the buzz, the choir warmed up and musicians tuned their instruments.

A young priest in his 40s -- this is all relative -- greeted students who were eager to shake hands and say hello. There was a palpable energy permeating the stone chapel, a vibrancy that only comes from young people who feel welcome and valued. The liturgy was lively, uplifting and holy.

From beginning to end, the Mass was a stark contrast to the services I’ve often experienced at parishes that haven’t yet figured out how to integrate the energy of younger people into their faith communities.

The church needs the wisdom of those who have lived life. But it also needs the energy, insight and creativity of those just starting out. It shouldn’t be either-or, but both-and.

Surely, the church has enough room for young people. Its future depends on it.