A Shadow was a secret ninja technique where a doppelgänger would be created.
After saving Kiku and Ayame from a falling boulder, Rikimaru was trapped in a cave. He escaped by going through Mei-Oh's portal where he encountered Mr. D CEO. While he was away, he manifested a "Shadow" of himself as a kind of astral projection. The shadow of Rikimaru retrieved the Izayoi from his grave site and answered the call of duty for Matsunoshin Gohda.
Background Information and Notes
The shadow of Rikimaru actually had a different character model with a different hairstyle, lacking the "devil horns." The shadow's Latissimus dorsi and Deltoid muscles were also noticeably smaller than the Rikimaru who emerged from the portal.