I would just write the same polite letter you send to medschools you withdraw from. like
Dear Blah,
I have been offered a research position and would like to withdraw from your consideration. Thank you for your time.
sincerely,
XX
When doing the same, I felt bad initially (esp after interviews) but after seeing how manipulative some of these researchers are, it stopped bothering me real fast. (I would actually email or call instead writing a letter since it's nice to let them know asap so that they can hire someone else).