Fetching details from the dictionary...

to happen to pass by
偶然通り掛かった人に道を尋ねた。
I asked someone who happened to pass by for directions.
偶然事故現場を通り掛かって本当に驚いた。
I was surprised when I passed by the accident scene.
店の前を通り掛かると良い匂いがした。
When I passed by the store, there was a nice smell.