In general, one is not allowed to rule on a halachik quandary in place of his Rabbi. (What exactly is defined as 'in his place' is a separate discussion.) The Shulchan Aruch YD 242:9 rules like the Ri as quoted in Haghot Maimoniot 5:3 in Hilchot Talmud Torah that:
כל הכתוב בספרים מפסקי הגאונים יכול להורות בימי רבו, רק לא יורה דבר מלבו ולא יסמוך על ראיותיו לדמות מילתא למילתא מעצמו.
any ruling found in the written works of the Geonim [which for the Ri was the previous few hundred years] can be ruled in [front of] his Rabbi, only that he shouldn't rule something from his own [opinion], and he shouldn't rely on his own proofs to compare one case to another on his own.
Thus it seems that if something is written straight up in an acceptable text, then following it is not considered passing a halachik legal ruling. Moreover it seems that a ruling, fundamentally, is taking known rules and applying them into new cases that haven't previously been dealt with. Our sifrei halacha are significantly more detailed than "Geonic" works and many of the cases that one looks up are explicitly dealt with, so by using one perhaps one can argue that it is not a case that requires a new ruling.
HOWEVER, I caution that this ruling is specifically regarding someone who otherwise has an idea what's going on and is just being worried about ruling in front of his Rabbi. As we all know, there are many different opinions in lots of written materials, especially nowadays. So unless you have learned the whole sugya and have some idea which opinions are and are not normative in your tradition, I would still strongly encourage you to speak to your Rabbi.
The phenomenon you may be referring to would seem to be in a case where that is not practical. If you are indeed stuck somehow with only some book, then choosing which book you will use is likely based on what you have seen your Rabbi use in the past, or at least heard that other Rabbis have used in the past. So in a way you are using a received tradition regarding how to choose, which is most of what psak is anyway. This, I imagine, is why people in a pinch rely on Sefer X: they have learned that it's a good bet.
And of course, CYLOR before believing anything I just wrote :)