What is the difference between a ceilidh, a ceili and a barn dance?

No matter what the exact name, historically and collectively speaking, a ceilidh, ceili or barn dance is a get-together of farm folk in the British Isles.