Some personal injury law firms now automatically target online ads at anyone who enters a nearby hospital’s emergency room and has a cellphone. The ads may show up on multiple devices for more than a month.