Summarize:

Monarchies often have specific terms of address borne of their countries' traditions. Search online or in etiquette books for the terms of address for the specific monarchy. The term "Your Majesty" is common and unlikely to cause offense. This term is the proper way to address most queens, from Queen Pengiran Anak Saleha of Brunei, to Queen Mathilde of Belgium. Use "Her Majesty" instead of "her" when writing or speaking about these queens in the third person. If a monarch's title includes "Empress," or if the nation she heads traditionally considers itself an empire, she should be addressed as "Her Imperial Majesty."
Try to find the specific form of address. When in doubt, use "Your Majesty." Address Empresses as "Her Imperial Majesty."