MB3 55b: Can a Non Jew Turn on a Light for you on Shabbos (276:1)

If a non-Jew lights a candle (or any melacha) specifically for a Jew on Shabbos, no one is allowed to benefit from it. When can one derive benefit from it (if at all)? What if it was turned on b'heter (e.g. for a choleh)?