The Bible speaks about various positive outcomes to suffering, or reasons why we can rejoice in suffering. However, one which I think we often miss out on is that as we suffer Christ actually suffers with us. It’s not simply that we suffer like Christ or that we suffer in his name—although both are also true—but the NT offers tremendous encouragement in the mystery that Jesus actually in some way suffers with his church. This truth, forged in the OT with texts about God walking through the fire with us or being in the fire with us (cf. Is. 43; 63:9; Dan. 3:25; Ex. 33:14), is only ratcheted up in the NT through union with Christ.
This truth is rooted in our individual and corporate union with Christ, the fact that I personally am one with Christ through faith and that the Church is united as one body with Christ. This union is so real and personal, and yes “mysterious,” that not only do I receive all of Christ and the benefits in him (righteousness, adoption, resurrection) but also he participates in my life. This means in the midst of suffering, trials, pain, and discouragement that Jesus suffers with us. As we look at a few verses on this I think you’ll see that the “with” suggests more of a oneness than it does mere nearness, meaning he’s not only there with you but he suffers with you.
“And falling to the ground he heard a voice saying to him, ‘Saul, Saul, why are you persecuting me?’” (Acts 9:4)
“The Spirit himself bears witness with our spirit that we are children of God, 17 and if children, then heirs—heirs of God and fellow heirs with Christ, provided we suffer with him in order that we may also be glorified with him.” (Rom. 8:17)
“For as we share abundantly in Christ’s sufferings, so through Christ we share abundantly in comfort too.” (2 Cor. 1:5) You’ll notice in the context that the sufferings Paul says we share are the same afflictions we have that God comforts us in. meaning, “Christ’s sufferings” here are the very sufferings in this life we go through.
“that I may know him and the power of his resurrection, and may share his sufferings, becoming like him in his death.” (Phil. 3:10) Again, notice the context of sharing in Christ’s sufferings is through our own earthly afflictions.
“But rejoice insofar as you share Christ’s sufferings, that you may also rejoice and be glad when his glory is revealed.” (1 Peter 4:13)
Is there not great hope and encouragement in simply knowing that as we suffer Jesus suffers with us? Our incarnate Immanuel, God with us, not only took on flesh so he might suffer on the cross in our place but he also took on flesh so that he might enter into suffering with us. You’re not only “not alone” in your sufferings but Christ suffers too. This means in the midst of suffering in the night while you lay on your bed you don’t have to remind or convince God of your suffering but your prayers are to one suffering with you. He doesn’t just intellectually know that you are suffering but somehow he intimately knows your sufferings because he is suffering with you.
Not only does this fit into our suffering but it fits into other parts of our life, since all of our life is joined to Christ. For example, it means in the midst of disillusionment or loneliness that our complaints—“No one gets me. No one is with me. No one sees or knows or understand what I’m going through.”—are answered by the reality of Christ’s union with us.
Doesn’t the doctrine of union with Christ as it applies to suffering encourage you and knit your heart to Christ even more? What a “one flesh” union. What a hope filled promise for the believer. Being “in Christ” is then not only our hope in salvation but in suffering also. Or, to say it differently, union with Christ results in Jesus sharing his accomplishments with us and us sharing our afflictions with him.
We have twice the reason to rejoice and have hope in suffering through this union with Christ. Not only can we be reminded what’s his is ours, which means his strength and resurrection life belong to us as we endure, but what’s our is his so that we never will suffer alone. We are comforted by the fact that Christ suffers with us but also strengthened in confidence knowing that Christ will endure and conquer and so will we in him. “Jesus, our head, is already in heaven; and if the head be above water, the body cannot drown.”
Here are two quotes from those who’ve recognized and rejoiced in this wonderful truth (John Flavel & John Murray).
“We do not only partake of what is his, but he partakes of what is ours: he hath fellowship with us in all our wants, sorrow, miseries and afflictions; and we have communion with him in his righteousness, grace, sonship and glory: he partakes of our misery, and we partake of his blessedness; our sufferings are his sufferings (Col. 1:24). O, what an honor is it to you, poor wretch, to whom a great many would not turn aside to how you are; to have a King, yea, the prince of all the kings of the earth, to pity, relieve, sympathize, groan and bleed with thee, to sit by thee in all thy troubles, and give thee his cordials; to say thy troubles are my troubles, and thy afflictions are my afflictions: whatever touches you, touches me also. O what name shall we give unto such grace as this?” 
“It needs to be noted that they suffer with him and this joint participation is emphasized in the case of suffering as it is in the case of glorification. This is both the reason for and the and the import of the emphasis which is placed in the New Testament and particularly in Paul upon the sufferings of the people of God as the sufferings of Christ. Believers do not contribute to the accomplishment of expiation…Nevertheless there are other aspects from which the sufferings of the children of God are to be classified with the sufferings of Christ himself. They partake of the sufferings which Christ endured…Again union and communion with Christ are the explanation and validation of this participation.”