Many OSS licences include some sort of provision for patents. See for example here the Apache licence: http://en.swpat.org/wiki/Patent_clauses_in_software_licences...
It also mentions that there is an 'implicit' patent grant provided by the revised BSD license[1] but that it has never been tested in court (which I presume means it is not advised).
I guess Apache 2.0 (or if you're a copyleft kind of guy, GPL3) is the way to go!
[1] http://en.swpat.org/wiki/Patent_clauses_in_software_licences...