If some non muslim says imagin that he is muslim and imagin me as your husband to a widow girl and then they imagin having sex and takes a pleasure by imagining having sex. Is this a act of adultery? Later the girl feels so ashamed of her shameful act that she is unable to eat properly and could not sleep and repent to ALLAH sincerely. Will she be forgiven.
If you mean they both talked on phone or text and masturbated while talking with each other, this is totally prohibited and she must sincerely repent to Allah while showing deep remorse and never talk with non mahram men like this!
However, this is not adultery but zina of ears and mouth if they talked.