Create the login on primary db first. And then, give it the permissions you want. After that, get the SID of the login by using this code:
select sid from sys.syslogins
where name = 'login_name'
And finally, create the login on read-only db with the same SID of the login.
sp_addlogin 'login_name', @passwd='mellon',
@sid = the_sid, @defdb='MASTER'