Aircraft have ELT that broadcast location. They are similar to the marine EPIRB or hiking PLB.
MH370 had 4 ELT, 2 on life raft, 1 in cabin, and 1 mounted to aircraft. The latter would have activated on crash but it was designed for ground crash not ocean. It would have sunk with plane. The life raft ones are water activated but probably sunk. ELT are more meant for finding survivors and not the crash site.
There are ejectable beacons but they are probably not required. It would make sense to add one for water crashes.
Though I assume the engineering and regulation means such a thing has a decade+ lead time and then would only exist on new planes.