Could be a combination of both.
I had a Mustang GT & the battery died one night, I got it jump started but by the time I made it home, the alternator was fried... almost literally, the alternator was hot enough to fry an egg after about 10 minutes (I think voltage regulator went bad).
Had to get a new battery & alternator (didn't have time to deal with rebuilding it).
If you have a good auto parts store nearby, see if they can test your battery charging ability and the alternator to see if it's charging & putting out at least 12.5 volts at idle. 12.5v is the minimum I'd want at idle on a stock alternator, 13v - 14v would be better.
What you need will depend on how old the battery is & how many miles that alternator has on it.
A good MAXX battery at Wal-Mart should run less than $85 if you get the biggest one that fits under the hood of a Ranger. Bigger (cranking amps) is always better.
You could probably get a rebuilt alternator for about $130 (with core return) from most auto parts stores. You'll probably only get a 95 amp alternator at most parts stores unless you get the 130 amp one from an Explorer (if they're even compatible), but for a few bucks more, you could order a high output alternator 200 amps or more for around $200 - $250.
Hope that helps,