The following is an extended quote from Gregory of Nazianzus, Oration 30.5 (one of his Five Theological Orations), written near the time of the Council of Constantinople (AD 381). The work is a refutation of the Eunomians/Anomeans/Neo-Arians, who thought that the Son did not eternally share the same nature as the Father. As part of his argument he discusses the relationship of the Father to the Son when he is hanging on the cross.
If the Father and Son share the same essence/nature, how can they be separated at the cross? What could Jesus have meant when he exclaimed (quoting Ps 22.1), “My God, My God, why have you forsaken me?” Gregory answers:
Why? You will say. Is [the Son] not subordinate now? If he is God, does he need at all to be made subordinate to God? You are talking as if he were a bandit or an opponent of God!
No–look at this fact: the one who releases me from the curse was called “curse” because of me; “the one who takes away the sin of the world” was called “sin” and is made a new Adam to replace the old. In just this way too, as head of the whole body, he appropriates my want of submission. So long as I am an insubordinate rebel with passions which deny God, my lack of submission will be referred to Christ. But when all things are put in submission under him, when transformed they obediently acknowledge him, then will Christ bring me forward, me who have been saved, and makes his subjection complete. In my view Christ’s submission is the fulfillment of the Father’s will. As we said before, the Son actively produces submission to the Father, while the Father wills and approves submission to the Son. Thus it is that he effects our submission, makes it his own and presents it to God. “My God, my God, look upon me, why have you forsaken me?” seems to me to have been the same kind of meaning. He is not forsaken either by the Father or, as some think, by his own Godhead, which shrank in fear from suffering, abandoning the suffer. Who applies that argument either to his birth in this world in the first place or to his ascent of the cross? No in himself, as I have said, he expresses our condition. We had once been forsaken and disregarded; then we are accepted and now are saved by the sufferings of the impassible. He made our thoughtlessness and waywardness his own, just as the psalm, in its subsequent course says–since the Twenty-First Psalm [LXX, English = 22nd], clearly refers to Christ.
When representing humanity on the cross, Christ does not cease to be divine. He subordinates himself on our behalf, but he can only humble himself if he were exalted in the first place. The Father and the Son did not have separate intentions because sharing the same nature entails sharing the same will. Miroslav Volf captures this idea when he recently tweeted: “Christ is not a third party inserted between an angry God and sinful humanity; he is the God who was wronged embracing humanity on the cross.”