Firstly, the initial raise was to $35. The typical pf raise in 2-5NL is $15/20. Your initial thought process in such a situation should be to fold. Granted though, with a hand like J9 suited and 3 callers infront of you, you have a hand that plays (or draws) pretty well post flop and (at that stage) 4/1 on your money to see a flop - which (like in this instance) could hit you square in the face.
The guy with A-9 who leads out is keen to protect his hand and may want paid from the initial pre flop raiser. J-Q, J-8, 7-8, A-10, Js, Qs, Ks & As are all 'likely' to call the $50. The button spoils the party (was he drunk

) and therefore you find yourself (on the flop) in exactly the same situation as you probably would have found yourself on the river - all-in with the worst hand. If danger cards or a 10 comes on the turn you mayyyy have gotten away.
In my opinion, you got unlucky for an opponent to hold the case 9 and one of 4 better hole cards. To mitigate against it happening again you should fold for $35 pf in the same spot or squeeze to $80 to thin the field. That way A-9 almost certainly folds pre and you find yourself against someone slow-playing an overpair or AK/AQ(ish) ranges in which case you could lift a significant pot. If you get shoved on pre because they have 10s, Js or better then you've lost $80 and not $500!