After taking enough steps, the Egg will hatch into a level 5 (Generation II and III)...first-stage Pokémon of the female species's (or non-Ditto parent's) evolutionary chain.
Prior to Generation VI, if the father knows any moves that are TMs or HMs in that game...that the baby is also compatible with, it will inherit the move. If a Pokémon species that is gender unknown (such as Magnemite) breeds with Ditto, the resultant baby will inherit any compatible TM or HM moves that the non-Ditto parent knows.
A Pokemon can inherit shadow ball only if it can hatch from an egg (so no legendaries, and evolved Pokemon can know it only if its basic stage can know it), is either genderless or can have a mother (so no all male families), and can learn shadow ball by TM.
However, genderless Pokemon can breed only with Ditto, so they can inherit shadow ball only from a parent of the same evolution family. For example, if you teach shadow ball to a Solrock, then you can never breed that shadow ball onto a different species.
Volbeat (all male but can hatch from eggs laid by Illumise)
I think it's also worth mentioning that Sableye and Shuppet learn shadow ball by level up and can then pass it to other Pokemon in the human-like and amorphous groups, respectively. Also male Smeargle can sketch shadow ball and then pass it to Pokemon in the field group.