There aren't too many writers that can easily exist within the fantasy and SF genres concurrently. As much as both are about fictional characters existing in situations that are various degrees of fantastic (and as "Star Wars" kind of proved, you can take the trappings of SF (i.e. spaceships and rayguns) and drape it over a total fantasy scenario and as long as there are fuzzy teddy bear men, no one is really going to spend too much time pondering its ultimate place on the scale, or at least no one who wants to be accused of having too much free time on their hands), its not like the two genres are interchangeable (although their detractors might suggest otherwise) as both have somewhat different ground rules and built in fanbases that expect different pleasures from them. So while both are technically "writing" they flex different imagination muscles, if that makes any sense.
Still, there are some writers that have tried in the past. And while Tolkien's epic "Love Slaves of the Moon Men" is sadly lost to history (for those who want to point to "Gandalf Goes to Mars" as hard evidence, I must say you've been deluded by an obvious forgery), writers who tend to focus mostly on character have had the easiest time of straddling both genres, with writers like Lois Bujold and CJ Cherryh managing to dabble more or less successfully, even if they're probably better known for their predominately SF works. But the trick is, if your grasp on characterization is strong enough and you've got a good head for world building, then you can probably write a passable entry into either genre, even if people aren't exactly going to be coplaying your characters at conventions.
Larry Niven is probably not the SF writer I would have picked up to try his hand at fantasy. His SF works are so hard science that its the kind of thing MIT students fact-check for pleasure (and remind us how much smarter than the rest of us they are) with every concept that appears in the stories backed by solid theory and probably reams of math equations that I'll just look at and nod and assume are correct. Niven is the kind of SF writer you read when you want plausible space action in a future that is theoretically possible, which of course makes it more exciting to imagine living there. However, he is the kind of writer where the concept tends to carry the story and in those instances where the underlying idea may not be quite as fascinating as he thinks it is, he's not often able to craft enough gripping characterizations to bring you through without the real risk of losing your interest at some point.
His solution here is to basically approach fantasy in Larry Niven terms, which is to apply a rigorously rational approach to the concept of the world and have you focus on the particulars of that. To that end he postulates an Earth that exists before recorded history where magic was once plentiful and made people capable of great things. Unfortunately it was also a finite resource and because humanity's general relationship with pretty much anything bountiful is to treat it much like I would if locked into a warehouse containing the last pizzas ever created, that is gorge myself until all the resources are exhausted for good or I'm obliterated in an orgy of guiltless consumption.
Thus the first novella in the collection pretty much lays out the concept as a handful of characters ranging from a warlock named Warlock, a dude with a clubfoot, a mercenary, a lady wizard and a marvelously snarky talking skull do their level best to strip mine the last remaining magic in the world since its getting about as scarce as jazz standards in a heavy metal setlist. Daringly, this plan involves tapping a sleeping god and essentially drinking his milkshake, not the world's safest scheme. It shouldn't be too surprising it doesn't go exactly as planned. It makes for an interesting story and is quite readable as it weaves its way through several setpieces. Unfortunately it also suffers from the Achilles heel of pretty much every Niven story, in that its more wedded to a fascination with the concept itself than going out of its way to make you care about the characters or the tragedy of their situation (in a sense its like rich people complaining about running out of money, I'm sympathetic to an extent but since I've never been rich there's a part of me that would be like "Welcome to the rest of us, buddy"). But he has a surprisingly good grasp of the fantasy genre for someone who is normally so Doctor Science and its pretty obvious he's throught through the mechanics of the situation.
But as decent as that story is, its clear that the concept had a lot of life in it and after the initial story was published Niven came back to the setting a couple more times, with the only difference being he brought friends. Thus the remaining two sections of the collection deal with a couple stories that Niven himself wrote, with the rest representing a Murderer's Row of sorts of people he dragged in to pen their own tales. His own story in this collection is short and sweet and seems to be a parody of Conan the Barbarian type stories, contrasting the magic based world with the more brutal (but far more in shape) sword swinging world to come.
He then gets out of the way and lets everyone else take over. Most of the writers seem to be obsessed with the idea of the magic based world giving way to "our" eventual world, which basically means you get a pretty standard magic tale that has a twist at the end revealing that its *gasp* the ancient world we know (Fred Saberhagen's "Earthshade" can probably be accused of this, as well as Dean Ing's "Manaspill" . . . both of which are okay but nothing special). Barnes' ". . . But Fear Itself" shoots for a similar modern resonance but frankly a week after reading all three of those stories I can't remember too much about them even after flipping through again.
However, fortunately an actual grown up shows up to show the rest of the kids how it's done and by far the best story of this sequence is Poul Anderson's (with assistance from Mildred Downey Brown) "Strength" which takes the concept much further than the other stories do and explores exactly what kind of world a magic-free existence will have to evolve into as a man geared for survival lands in a village where one of the last remaining magicians stays with her books. Anderson and Brown paint a vibrant picture of a village that has to reinvent itself to survive, as the newcomer attempts to drag them kicking and screaming into a world where they have to fend for themselves as the world that was passes away into the ether more and more day by day. It makes for a wonderful tension and a poignant look at the real cost of running out of something you depended on and how hard it is to learn how to cope. Anderson's written fantasy stories before and has a knack for strong characterization so this one fits right in his wheelhouse and winds up being a memorable story.
By the time we get to the third and last collection, we get two Niven stories, one of which ("A Lion in His Attic") shows him having a bit more fun with the idea and just telling a straightforward tale in the setting, one that feels oddly like something Neil Gaiman would have toyed with, even more fantastic than I would have expected from Niven. Bob Shaw goes the "its going to be the real world someday!" route with a decent tale of a magician scheming to make a king's plan go horribly wrong, a hearty slice of manipulation and plotting that seems cheapened by its climax.
Niven's last tale in the collection actually winds up being one of the more charming ones. With help from Dian Girard, "Talisman" gives us the story of Sparthera, a young lady thief who is looking to get rich enough to set herself up for life and winds up robbing the wrong person, winding up getting roped into his plans in way she didn't quite intend. This one wins from the interactions between the thief and her quarry as the two of them get thrown together and have to figure their way out of a problem that gets way out of hand, getting a grudging (at first) respect for each other in the process. Its another story that uses the setting as an excuse to explore how people will live in the new world without being so focused on drawing parallels to the modern day world.
Still, for all my griping about the modern day stuff, the one story that grabs the concept and yanks it wholeheartedly into the real world is done by probably the only writer that could conceivably make this workable: Roger Zelazny. Probably one of the most exuberant and lyrical writers SF has ever seen, he dispenses entirely with the fantasy setting as "Mana From Heaven" gives us David, a magician that has been around for centuries and is currently living in the present day. Life's going fairly well for him, he's got a nice job, a girlfriend and an agreement with the other remaining magicians to use the mana that's left in the world wisely so there's enough for everyone.
The whole story is incredibly well thought out, from the interpersonal dynamics and relationships between the magicians, the real threat of how an influx of mana could upset delicate truces, and how magicians would fight each other without it turning into that issue of Alan Moore's "Miracleman" where London gets wrecked and the bodycount hits quadruple digits. Its a story that looks to the past and also to the future and manages to singlehandedly open up the concept and add dozens of nuances to it that Niven probably hadn't even considered. It manages to find joy in a gradual diminishing and hope in what could be. In terms of what story resonated with me the most, this one wins hands down (with Poul Anderson's coming a fair second) and shows the rest up as well meaning intellectual games at times, people challenging the limitations of a new format but not quite willing to dig deep. This one dives and comes up rich and while there's no duffers in the whole collection, Zelazny makes it clear the difference between working with the concept and getting it purely.