What is the difference between "on doing", "by doing", and "in doing"?
A difficult point to French learners of English as in all three cases, you would say "en faisant".
Example sentences, taken from the Longman Dictionary of Contemporary English:
What was your reaction on seeing him?
Howard had put his own life in danger in trying to protect the Queen.
She earns her living by selling insurance.