The bar on top of aviator sunglasses is to keep sweat or debris from falling into your eyes. This was particularly necessary given the history of aviator sunglasses — they were originally designed for pilots in World War One.