Viewer:
Viewers are in particular those who are watcing televison.
A viewer could be also someone looking carefully at a picture or any other interesting object, like an artifact, sculptures in a museum, paintings and pieces of art in general.
Spectator:
It refers also to someone watching something ,that is more likely to be a public event or activity ,but specifically sport events such as tennis matches, horse racing events etc...
Audience:
Refers to the ones watching or listening to a rather publically held event such as concerts, plays, public meetings.The people come to a certain place to watch this event ,whether a movie, a performance of any kind or a speech.
When you say 'the audience of a television or radio progamme' you refer to all the people as a group watching or listening to it.
A writer or an artist could have 'an audience' and that would be the people who read his work or look at his work.