The exosphere is the uppermost layer, where the atmosphere thins out and merges with interplanetary space.