A few months ago, Rabbi Yaacov Katz (a Rosh Chabura in the Mirrer Yeshiva)
and I were among eight people who were needed to make a minyan for
mourners whom we didn't know. As the other six left after the davening,
they said perfunctorily "Hamakom Yinachem..." (the standard line of
consoling a mourner). Rabbi Katz sat down and said to these
strangers "tell me something about your mother..." We stayed there for
about ten minutes listening.
"And it was after the death of Avraham that G-d blessed Yitzchok
(Avraham's son)..." (Biraishis 25:11) The Gemara in Sota 14a learns
that this was G-d's way of comforting a mourner, and we are supposed to
emulate the ways of G-d.
That day, some of us did a mitzva of helping make a mourner's minyan, and
others also really fulfilled the mitzva of consoling mourners. (By the
way, no one has the real secret of what to say to mourners, but certainly
showing that you are concerned and interested goes a long way.)