Both words are primarily adjectives. Rahman is used both as a proper noun for God (e.g. 17:110) as well as an adjective (e.g. 59:22):
Since you asked this question in reference to Bismillah, it should be noted that both are used as attributes here. Both words allude to different shades of meaning of رحمة
(kindness):
- Rahman indicates the high intensity of
رحمة
and
- Rahim refers to its perpetuity.
Let me quote Islahi. He writes:
The noun Rahman is the intensive form of Fa‘lan (eg: Sakran and
Gadban), while the noun Rahim is an adjective of the form Fa‘il (eg:
‘Alim and Karim). A look at the usage of the Arabic language shows
that the form Fa‘lan expresses great fervency and enthusiasm, while
the form Fa‘il expresses steadiness and perpetuity. In other words,
the first depicts vigour and the second constancy in God’s mercy. A
little deliberation shows that the Almighty’s mercy on His creation
possesses both these characteristics. The enthusiasm and warmth is
complemented by permanence. It is not that His attribute of Rahman
induced Him to create, and He later forgot to foster and sustain His
creation. Indeed, He is nourishing and taking proper care of them
because He is Rahim as well. Whenever a person invokes His help, He
hears his calls and accepts his prayers. Also, His blessings are not
confined to this world only. Those who lead their lives according to
the path prescribed by Him, shall be blessed with eternal life and
joy. It must be conceded that all these aspects cannot be comprehended
without an integrated understanding of these attributes.