Ed, speaking NFHS, if the foul occurs before the touchdown is scored, treat it as a liveball foul and enforce it under the all but one principle. The penalty will be enforced from the spot of the foul since it was behind the basic spot. If the foul occured after the score, it is enforced as a dead ball penalty from the succeeding spot (the try). If there's any doubt, I'd consider making it a live ball foul.
In either case, if the foul is flagarant, disqualify A78. I would strongly consider disqualification for a blind hit 50 yards behind the play that decleats the B player.
This is a penalty I flagged a lot last season. I was surprised how often it happened but that is why it is so important for those of us behind the play to be vigilantly cleaning up this kind of behavior.