Heat up a gas or charcoal grill using medium-high heat. Once hot, brush the grates to clean them.
Either peel the sweet potatoes or scrub them under running water and dry them thoroughly. Trim off any dried ends. Cut the potatoes in half lengthwise and then cut crosswise into approximately ¼" thick slices. If the potatoes are narrow, you can skip cutting them in half lengthwise. If they're very large, you might want to cut them into quarters lengthwise (which is what I did for the photos) before cutting them crosswise.
Line a baking sheet with two layers of foil. The foil should be a bit longer than the baking sheet, about 18".
Spray the foil with cooking spray, then sprinkle the salt and pepper evenly over the foil.
Lay the sweet potato slices in a single layer on the greased and salted foil. Leave approximately 1" of space around the border of the foil on all sides.
Spray the slices with more oil and sprinkle with more salt and pepper.
If using herbs, toss in 4-5 sprigs of fresh thyme. If using fresh rosemary, roughly chop the leaves from 1-2 sprigs and sprinkle over the slices. You can use both thyme and rosemary or just one.
Spray a third sheet of foil (the same size as the first two) and lay the foil oil-side down on the sweet potatoes. Carefully crimp together the edges of the top and bottom layers of foil so no steam can escape. Leave the foil on the baking sheet - it's a handy way to transfer the potatoes to the grill.
Carefully slide the foil packet onto the heated grates, then close the lid. Let cook, without touching, for about 18-22 minutes.
Slide the foil back onto the baking sheet (a BBQ spatula or heat-proof glove is helpful for this). Carefully rip open a corner of the foil packet (if the foil is too hot, let it cool for 5 minutes first), then continue to pull away the top layer of foil so the potatoes can cool a bit.
When they're ready, discard any thyme sprigs (or chop the leaves and sprinkle over the slices). Use a spatula to carefully transfer the slices to a serving plate or platter. Spritz all over with the lemon or lime wedge. Then enjoy!