All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Tracing back the child to other than his father is one of the grave major sins. Abu Tharr narrated that he heard the Prophet saying: "If a man claims to be the son of a person other than his real father, and he knows that that person is not his father, he but disbelieves in Allaah.”
The phrase “disbelieves in Allaah” here is interpreted with two different interpretations:
a- It applies to the person who believes that this act is lawful.
b- Being ungrateful to the bounties of Allaah.
In any case, this is evidence that it is an act of great evil to do this thing and that it is not permissible to resort to it. For more benefit on the prohibition of tracing back a son to other than his father, please refer to Fatwa 82371, and to Fatwa 89932 on the prohibition of a wife taking her husband’s family name.
As for the devil harming children, then this is possible. However, we do not know any evidence that the angels protect the children until they reach puberty. Imaam Ahmad reported that a woman came to the Prophet with a child who was possessed by jinn and then the Prophet said (addressing the jinn possessing the boy): "Get out, O enemy of Allaah.”, then the child was cured.”
For more benefit on how to treat magic and possession by jinn, please refer to Fataawa 85500 and 82918.
As regards your judgment about your friend that she is wrong in marrying that man just because they have whispers, then this is a wrong judgment. However, one should not hasten to say that he/she is affected by magic, unless there are evident symptoms, otherwise one will have whispers that could lead to unpleasant consequences. For more benefit on the symptoms that indicate that a person is possessed by jinn, please refer to Fatwa 84547.
Finally, it should be noted that a Muslim is in principle innocent until he is proven guilty because it is not permissible for your friend to accuse her ex-husband to have done magic to her or to her son without evidence.
Allaah Knows best.