When it is used in response to a request or suggestion, surely means certainly and they can be used interchangeably.
Compare the following:
- Can you give me a hand washing up?Surely! / Certainly! / No problem!
- Would you join us for supper tonight?Surely! Where are you eating?
However, surely can also be used to express the speaker’s surprise that something is happening. Certainly CANNOT be used in this way.
Study the following and, as you say them to yourselves, give surely fairly heavy stress:
- You’re surely not going out again tonight, are you? You went out last night.
- Surely that can’t be Felicity standing over there? I thought she was in Australia.
- I can’t get any reply, but there’s surely somebody at home. They can’t all be out.
- Surely you’re not suggesting she poisoned him on purpose?I can’t believe you could think that!