I think the general rules are:
words ending in a consonant - masculine; words ending 'а' or 'я' - feminine; words ending 'о' or 'е' - neuter; words ending 'ь' - masculine or feminine (I think you just have to memorise these).
There are some exceptions, e.g. 'папа' is masculine.
Hope that helps. I've not been doing this long, so hopefully someone with a bit more experience will confirm (or correct) what I've written above.