In German there are three genders for nouns: masculine, feminine and neuter. There are some rules for each gender regarding how the words are formed, however the best bet is to learn each gender with the words.
There are also four cases in German: the nominative (subject), accusative (direct object), dative (indirect object) and genitive (this isn't particularly important as even Germans drop it). These affect how the words 'the' and 'a' are formed.