A. They said that it rained when they had come out of the theatre
B. They said that it was raining heavily, when they had come out of the theatre
C. They said that it had been raining heavily, when they came out of the theatre
D. They said that it had been raining heavily, when they had come out of the theatre
Explanation
The correct nearest indirect speech sentence for "They said, 'It was raining heavily, when they came out of the theatre'" is: They said that it had been raining heavily, when they came out of the theatre.
Convert the object of Active Voice Sentence into the subject of the Passive Voice Sentence. Use helping verb was/were according to subject of the Passive Voice sentence.