Rationalist Kannada writer KS Bhagwan was heckled and ink thrown at him when he came to a court in Bengaluru to attend the proceedings in a private complaint.
A video showing a woman, reportedly a lawyer, throwing ink on Mr Bhagwan has been shared widely on social media.
The woman is heard shouting against the writer, saying he should be "ashamed" for his stand on religion.
Mr Bhagwan has often attracted criticism from the right wing, who have accused him of giving views that are "anti-Hinduism".
A police team probing the murder of journalist Gauri Lankesh said Mr Bhagwan's name was also on a list of targets of the alleged killers. He has been provided security for the last few years due to the threat perception against him.
The DCP of central Anuchet said a case has been filed against the woman, Meera Raghavendra.
The Kannada writer had come to the court from his home in Mysuru in response to a summons from the court after Ms Raghavendra filed a private complaint before the court against him for what she said were insulting and derogatory remarks against Lord Ram.
When he got out of the car, she attacked him with the ink, police said. In his complaint, Mr Bhagwan alleged threats to his life.
A case of wrongful restraint and criminal intimidation has been filed.