In the US, before deregulation FAA Rule 240 [1] covered this scenario. Now the specifics between airlines, but the place to look is the 'Conditions of Carriage' contract that each airline is required to abide by.
This Consumerist article [2] is out of date (2007), but it covers every airline's contract and I believe it remains mostly correct.
[1] https://en.wikipedia.org/wiki/Rule_240 [2] https://consumerist.com/2007/04/06/dont-fly-without-a-copy-o...