If a person is davening or learning Torah in another room, and overhears kaddish or kedushah from another room, he may respond, but he is not obligated to. The same applies if one is walking by a Shul. [This does not apply to women in the ezras nashim who are joining in to thedavening downstairs. They are obligated to respond, as they are joined in with the tzibbur.]
The possuk says that Yaakov Avinu bowed down towards the front of the bed. The Gemara says that this teaches that the shechinah rests at the head of a sick person’s bed. I am certain that the reason is because of the intensity of the sick person’s prayers, which should tell ussomething about how our Shuls should be!