The soul of the Niftar during Shiva:
Throughout the days of Shiva, the soul of the deceased is found in the home that it lived in. Elsewhere it states that the soul of the deceased hovers over the body for the first three days of Shiva. After the passing of three days, when the soul sees the change of look of the face of his body, he no longer comes to visit it.
Candles: We light a candle in the home in order to sooth the soul, which returns to the home where it lived and mourns there for seven days. [Some write that every Shabbos throughout the first year the soul of the Niftar comes to visit his family and having a candle lit helps sooth his soul. See Chapter 24 Halacha 3!]
Walking around the block: Some mourners are accustomed after getting up from Shiva on the seventh day to walk around the block of the Shiva home [starting from the right side] until they reach their home from the other side. Some say this walk accompanies the soul to its new resting place in heaven.
Matzeiva: The Matzeiva serves as a resting place for the encompassing lights of the soul of the deceased, and these encompassing lights come to rest on the Matzeiva after the Shiva.
 Tanya 67; Mavor Yabok Imrei Noam 35; Daas Torah 384; Torah Leshma 520 in name of Arizal
 Yerushalmi, Pnei Baruch 13 footnote 1
 Rama 384:3
 Rama 376:3 in name of Maharil and in 384:3
 Torah Leshma 520
 Darkei Chesed 25:11
 Arizal in Shaar Hamitzvos Vayechi and in Nagid Mitzvah Inyanei Aveilus