To cite gRain in publications use:

Søren Højsgaard (2012). Graphical Independence Networks with the gRain Package for R. Journal of Statistical Software, 46(10), 1-26. URL http://www.jstatsoft.org/v46/i10/.

Corresponding BibTeX entry:

  @Article{,
    title = {Graphical Independence Networks with the {gRain} Package
      for {R}},
    author = {S{\o}ren H{\o}jsgaard},
    journal = {Journal of Statistical Software},
    year = {2012},
    volume = {46},
    number = {10},
    pages = {1--26},
    url = {http://www.jstatsoft.org/v46/i10/},
  }