All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Scholars stated that it is permissible to console the disbelievers. They said that the Muslim should say “May Allaah Grant you better than him in exchange”. However, it is not permissible to attend the disbelievers’ funerals. Imaam Maalik said: “It is not permissible for a Muslim to wash his disbelieving father, follow his funeral or place him in his grave except in the case of necessity. He may bury him if he feared that no one will bury him.
Al-Hijjaawi, a Hanbali scholar said: “The Muslim is prohibited from following the disbelievers` funeral or to place him in his grave as it entails a sort of honor for him so it resembles offering the funeral prayer on him which is explicitly prohibited in the Noble Quran. However, if there is no one to bury the deceased from among the disbelievers, then the Muslim may bury him. Hence, the Prophet, sallallaahu ‘alayhi wa sallam, ordered ‘Ali Ibn Abu Taalib to bury his father. [Abu Dawood, An-Nassa`i and Ahmad].
So, our response to the questioner is that there is nothing wrong pertaining to the visit of your wife to her family and consoling them. You and other Muslims are permitted to do so as well. However, entering the church with them is considered a type of funeral prayer which is of the disbelievers’ characteristics. Therefore, a Muslim is prohibited from doing this as well as joining them in the burial or following the funeral.
Allaah Knows best.