Rules: Player Misses the Ball on Purpose

Players A and B, partners in a foursome competition, were faced with a difficult shot over a pond.  Player A, a poor player, swung but purposely missed the ball. Player B, an expert player, then played the ball to the green.

Is this permissible?

No. Since Player A had no intention of moving the ball, he did not play a stroke — see Definition of "Stroke" — and it remained his turn to play.
 
When Player B played instead of A, A and B incurred a penalty of loss of hole in match play or two strokes in stroke play — Rules 29-2 and -3. In stroke play, Player A must play a ball at the spot from which B played. If Player A did not do so before the side played from the next teeing ground, A and B were disqualified — Rule 29-3.
 
Definition of Stroke – a "stroke" is the forward movement of the club made with the intention of striking at and moving the ball, but if a player checks his downswing voluntarily before the clubhead reaches the ball he has not made a stroke.