If you happen to run into a bear, play dead.

Literal

By-chance bear [with-に] encounter-[conditional-たら], died pretense [object-を] do-[command-なさい].

出会う takes its target with に ('meet with a bear'). 死んだふり ('pretending to be dead') — the past-tense attributive 死んだ ('died') modifies ふり ('pretense, pretending'). The pattern「past-tense verb + ふりをする」is the standard 'pretend to X' construction.