Generally polyglots are written in a combination of C (which allows redefinition of tokens and even operators with a preprocessor) and a scripting language such as Lisp, Perl or sh.
The two most commonly used techniques for constructing a polyglot program are to make liberal use of languages which use different characters for comments and to redefine various tokens as others in different languages. Often good use is made of quirks of syntax. These are demonstrated in this public domain polyglot written in ANSI C, PHP and GNU bash shell:
#define a /* #\010Hello, world!\n