I would usually ask whether the seat is free, or whether they mind me joining them, or words to that effect. Depending on the circumstances I may try and engage in some light conversation. On the plane I will usually acknowledge whoever is sat next to me (assuming it's not my girlfriend or family) and chat briefly. I certainly hope I don't come across as miserable or intrusive. Not sure which is worse actually