How do I prevent grainy fudge?
Fudge is technically a crystalline sugar candy so a true fudge should have have the feel of tiny sugar crystals when you bite into it, but it should not be grainy.  Controlling the grain in fudge is a matter of controlling three things:  the temperature that you cook your mixture to (the soft-ball stage you referred to), the way the mixture is cooled, and the addition of certain crystal interfering agents (e.g. corn syrup, fats, marshmallow).  

I, personally, believe that controlling temperature is far superior to the drop-and-mash test from which the "soft-ball stage" inherited its name.  I also have had better results with the lower end of the range (235 °F) than with mixtures that have approached the higher end of the range (245 °F).

Marshmallow fudges, in my experience, rarely have the micro-crystal bite of fudges made without marshmallow.  Marshmallow fudges are sometimes called creamy fudges to denote their more-creamy/less-fudge-y mouthfeel.  Most marshmallow fudges don't really need careful attention to the cooling stage like fudges made without marshmallow.  I assume you are making a peanut butter fudge w/o marshmallow?

Now, having said that, for fudge that I make without marshmallow, I use a little bit of corn syrup (1 Tbsp. per 2 cups sugar per 5 oz. condensed milk - plus the chocolate or peanut butter or whatever) - I heat my mixture to a boil, then I allow the mixture to boil without stirring until the mixture reaches 235 °F, then I remove the pot from the heat and allow the mixture to cool undisturbed until the temperature lowers to 130 °F (keeping the thermometer in the mixture).  By doing this the goal is to create a supersaturated sugar solution - a mixture that is holding more sugar in solution than it normally should.  At this point I stir the mixture as vigorously as possible until it loses some of its gloss and it becomes increasingly difficult to stir - then transfer it into a heavily buttered pan to cool to solidify.  Losing the gloss and changing consistency are two signs that the sugar is re-crystallizing out of the supersaturated solution - the vigorous mixing should prevent larger sugar crystals from forming in the fudge (and prevent graininess).  

It is also important to prevent stray sugar crystals from "seeding" your mixture and bringing crystals out of your supersaturated solution prematurely and creating a grainy fudge - people usually control for this in one of three ways:  by buttering the sides of the cooking pan, by briefly covering the boiling mixture so that condensation drips from the lid onto the sides washing them down, or by brushing down the sides of the pan gently with water.

As a short summary - I shoot for 235 °F and focus more on the cooling of the fudge to prevent graininess.